mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-02-05 05:47:00 +03:00
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.
This commit is contained in:
parent
872fea9485
commit
3eef3f39a6
2
parser.c
2
parser.c
@ -13224,7 +13224,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
|
|||||||
/*
|
/*
|
||||||
* And record the last error if any
|
* 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);
|
xmlCopyError(&ctxt->lastError, &oldctxt->lastError);
|
||||||
|
|
||||||
if (sax != NULL)
|
if (sax != NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user