Selaa lähdekoodia

Fix double decref after failed PyList_SetItem in C tokenizer

PyList_SetItem steals the item reference even on failure, so the error path must not call Py_DECREF on the same object.

Co-authored-by: Cursor <cursoragent@cursor.com>
pull/361/head
zivenger 4 kuukautta sitten
vanhempi
commit
65d27ef6cd
1 muutettua tiedostoa jossa 0 lisäystä ja 1 poistoa
  1. +0
    -1
      src/mwparserfromhell/parser/ctokenizer/tok_parse.c

+ 0
- 1
src/mwparserfromhell/parser/ctokenizer/tok_parse.c Näytä tiedosto

@@ -1753,7 +1753,6 @@ Tokenizer_handle_single_tag_end(Tokenizer *self)
return NULL;
}
if (PyList_SetItem(self->topstack->stack, index, token)) {
Py_DECREF(token);
return NULL;
}
return Tokenizer_pop(self);


Ladataan…
Peruuta
Tallenna