Commit 09b6f818 authored by Nick Wellnhofer's avatar Nick Wellnhofer

Fix potential null deref in xmlRelaxNGParsePatterns

Thanks to Zhongyuan Zhou for the initial patch.
parent 01d8cf07
......@@ -5548,12 +5548,16 @@ xmlRelaxNGParsePatterns(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr nodes,
while (nodes != NULL) {
if (IS_RELAXNG(nodes, "element")) {
cur = xmlRelaxNGParseElement(ctxt, nodes);
if (cur == NULL)
return (NULL);
if (def == NULL) {
def = last = cur;
} else {
if ((group == 1) && (def->type == XML_RELAXNG_ELEMENT) &&
(def == last)) {
def = xmlRelaxNGNewDefine(ctxt, nodes);
if (def == NULL)
return (NULL);
def->type = XML_RELAXNG_GROUP;
def->content = last;
}
......
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