Commit 3eef3f39 authored by Nick Wellnhofer's avatar Nick Wellnhofer
Browse files

Fix NULL deref in xmlParseExternalEntityPrivate

If called from xmlParseExternalEntity, oldctxt is NULL which leads to
a NULL deref if an error occurs. This only affects external code that
calls xmlParseExternalEntity.

Patch from David Kilzer with minor changes.

Fixes bug 780159.
parent 872fea94
......@@ -13224,7 +13224,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
/*
* And record the last error if any
*/
if (ctxt->lastError.code != XML_ERR_OK)
if ((oldctxt != NULL) && (ctxt->lastError.code != XML_ERR_OK))
xmlCopyError(&ctxt->lastError, &oldctxt->lastError);
if (sax != NULL)
......
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