1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

SAX2: Make sure that OOM errors aren't overwritten

This commit is contained in:
Nick Wellnhofer
2024-01-26 11:39:51 +01:00
parent 12ce9b5ffe
commit 2e19d0ef04

10
SAX2.c
View File

@@ -1129,11 +1129,11 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
if ((xmlStrEqual(name, prop->name)) &&
((namespace == prop->ns) ||
(xmlStrEqual(namespace->href, prop->ns->href)))) {
xmlNsErrMsg(ctxt, XML_ERR_ATTRIBUTE_REDEFINED,
"Attribute %s in %s redefined\n",
name, namespace->href);
ctxt->wellFormed = 0;
if (ctxt->recovery == 0) ctxt->disableSAX = 1;
xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER,
XML_ERR_ATTRIBUTE_REDEFINED, XML_ERR_FATAL,
name, NULL, NULL, 0,
"Attribute %s in %s redefined\n",
name, namespace->href);
if (name != NULL)
xmlFree(name);
goto error;