Explorar el Código

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 hace 4 meses
padre
commit
65d27ef6cd
Se han modificado 1 ficheros con 0 adiciones y 1 borrados
  1. +0
    -1
      src/mwparserfromhell/parser/ctokenizer/tok_parse.c

+ 0
- 1
src/mwparserfromhell/parser/ctokenizer/tok_parse.c Ver fichero

@@ -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);


Cargando…
Cancelar
Guardar