diff options
author | Daniel Veillard <veillard@redhat.com> | 2010-11-15 12:06:29 +0100 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2010-11-15 12:10:14 +0100 |
commit | 0cbeb50ee03ce582a0c979c70d8fbf030e270c37 (patch) | |
tree | beae3f6c78c9922fbf1698216b7a7be3aee51d72 /xpath.c | |
parent | 364e3d2b054656f2cf97594365d15b2ddb72a9ed (diff) | |
download | libxml2-0cbeb50ee03ce582a0c979c70d8fbf030e270c37.tar.gz |
Fix a potential memory access error
in case of a previus allocation error
Diffstat (limited to 'xpath.c')
-rw-r--r-- | xpath.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3575,13 +3575,13 @@ xmlXPathNodeSetAdd(xmlNodeSetPtr cur, xmlNodePtr val) { } else if (cur->nodeNr == cur->nodeMax) { xmlNodePtr *temp; - cur->nodeMax *= 2; - temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * + temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 * sizeof(xmlNodePtr)); if (temp == NULL) { xmlXPathErrMemory(NULL, "growing nodeset\n"); return; } + cur->nodeMax *= 2; cur->nodeTab = temp; } if (val->type == XML_NAMESPACE_DECL) { |