HtmlParser: The logic error in htmlAutoClose()
if (newtag == NULL) {
htmlAutoCloseOnEnd(ctxt);
return;
}
while ((newtag == NULL) && (ctxt->name != NULL) &&
((xmlStrEqual(ctxt->name, BAD_CAST "head")) ||
(xmlStrEqual(ctxt->name, BAD_CAST "body")) ||
(xmlStrEqual(ctxt->name, BAD_CAST "html")))) {
if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
ctxt->sax->endElement(ctxt->userData, ctxt->name);
htmlnamePop(ctxt);
}
It's possible that newtag should be checked for non equality to NULL in the condition of "while"