mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
502960 provide namespace stack when parsing entity
* parser.c: copy the entity stack * SAX2.c: fix the warning message for default entities
This commit is contained in:
parent
a6c76a26ca
commit
74eaec1496
11
SAX2.c
11
SAX2.c
@ -2283,9 +2283,14 @@ xmlSAX2StartElementNs(void *ctx,
|
||||
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
|
||||
return;
|
||||
}
|
||||
xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
|
||||
"Namespace prefix %s was not found\n",
|
||||
prefix, NULL);
|
||||
if (prefix != NULL)
|
||||
xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
|
||||
"Namespace prefix %s was not found\n",
|
||||
prefix, NULL);
|
||||
else
|
||||
xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
|
||||
"Namespace default prefix was not found\n",
|
||||
NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
10
parser.c
10
parser.c
@ -12618,6 +12618,9 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
|
||||
xmlNodePtr last = NULL;
|
||||
int size;
|
||||
xmlParserErrors ret = XML_ERR_OK;
|
||||
#ifdef SAX2
|
||||
int i;
|
||||
#endif
|
||||
|
||||
if (((oldctxt->depth > 40) && ((oldctxt->options & XML_PARSE_HUGE) == 0)) ||
|
||||
(oldctxt->depth > 1024)) {
|
||||
@ -12644,6 +12647,13 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
|
||||
ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
|
||||
ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
|
||||
|
||||
#ifdef SAX2
|
||||
/* propagate namespaces down the entity */
|
||||
for (i = 0;i < oldctxt->nsNr;i += 2) {
|
||||
nsPush(ctxt, oldctxt->nsTab[i], oldctxt->nsTab[i+1]);
|
||||
}
|
||||
#endif
|
||||
|
||||
oldsax = ctxt->sax;
|
||||
ctxt->sax = oldctxt->sax;
|
||||
xmlDetectSAX2(ctxt);
|
||||
|
Loading…
x
Reference in New Issue
Block a user