parser: Check for malloc failure in xmlCtxtParseDtd

This commit is contained in:
Nick Wellnhofer 2024-11-17 12:11:41 +01:00
parent 7f8c436c75
commit 631778f679

View File

@ -11759,6 +11759,11 @@ xmlCtxtParseDtd(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
ctxt->myDoc->properties = XML_DOC_INTERNAL;
ctxt->myDoc->extSubset = xmlNewDtd(ctxt->myDoc, BAD_CAST "none",
publicId, systemId);
if (ctxt->myDoc->extSubset == NULL) {
xmlErrMemory(ctxt);
xmlFreeDoc(ctxt->myDoc);
return(NULL);
}
xmlDetectEncoding(ctxt);