瀏覽代碼

Fixed memory corruption caused by off-by-one error

master
ooxi 12 年之前
父節點
當前提交
1593b36a4a
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      src/xml.c

+ 1
- 1
src/xml.c 查看文件

@@ -544,7 +544,7 @@ static struct xml_node* xml_parse_node(struct xml_parser* parser) {
*/
size_t old_elements = get_zero_terminated_array_elements(children);
size_t new_elements = old_elements + 1;
children = realloc(children, new_elements * sizeof(struct xml_node*));
children = realloc(children, (new_elements + 1) * sizeof(struct xml_node*));

/* Save child
*/


Loading…
取消
儲存