浏览代码

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

tags/v0.2
Ben Kurtovic 12 年前
父节点
当前提交
a1e6dfcef6
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      mwparserfromhell/parser/tokenizer.c

+ 1
- 1
mwparserfromhell/parser/tokenizer.c 查看文件

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


正在加载...
取消
保存