Commit 658b86c0 authored by Gaurav Gupta's avatar Gaurav Gupta Committed by Daniel Veillard

Couple of Missing Null checks


Missing Null check could cause crash, if a pointer is dereferenced.

Found problem at two places in valid.c
parent 1db99699
......@@ -1798,6 +1798,7 @@ xmlCopyEnumeration(xmlEnumerationPtr cur) {
if (cur == NULL) return(NULL);
ret = xmlCreateEnumeration((xmlChar *) cur->name);
if (ret == NULL) return(NULL);
if (cur->next != NULL) ret->next = xmlCopyEnumeration(cur->next);
else ret->next = NULL;
......@@ -6996,6 +6997,9 @@ xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **names,
* Creates a dummy node and insert it into the tree
test_node = xmlNewDocNode (ref_node->doc, NULL, BAD_CAST "<!dummy?>", NULL);
if (test_node == NULL)
test_node->parent = parent;
test_node->prev = prev;
test_node->next = next;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment