Parcourir la source

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

tags/v0.2
Ben Kurtovic il y a 12 ans
Parent
révision
a1e6dfcef6
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. +1
    -1
      mwparserfromhell/parser/tokenizer.c

+ 1
- 1
mwparserfromhell/parser/tokenizer.c Voir le fichier

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


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


Chargement…
Annuler
Enregistrer