Ver a proveniência

Fix double decref after failed PyList_SetItem in C tokenizer (#361)

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/363/head
zivenger há 4 meses
committed by GitHub
ascendente
cometimento
c501415a48
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: B5690EEEBB952194
1 ficheiros alterados com 0 adições e 1 eliminações
  1. +0
    -1
      src/mwparserfromhell/parser/ctokenizer/tok_parse.c

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

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


Carregando…
Cancelar
Guardar