Sfoglia il codice sorgente

Ensure that there is null terminator at the end of entitydefs.

tags/v0.2
Ben Kurtovic 12 anni fa
parent
commit
a1e6dfcef6
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. +1
    -1
      mwparserfromhell/parser/tokenizer.c

+ 1
- 1
mwparserfromhell/parser/tokenizer.c Vedi File

@@ -1452,7 +1452,7 @@ init_tokenizer(void)
Py_DECREF(htmlentitydefs);

unsigned numdefs = (unsigned) PyDict_Size(defmap);
entitydefs = malloc(numdefs * sizeof(char*));
entitydefs = calloc(numdefs + 1, sizeof(char*));
PyObject* deflist = PyDict_Keys(defmap);
if (!deflist) return;
Py_DECREF(defmap);


Caricamento…
Annulla
Salva