mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-31 21:50:33 +03:00
parser: Fail on catastrophic errors in recovery mode
This commit is contained in:
4
parser.c
4
parser.c
@@ -12018,7 +12018,7 @@ xmlCtxtParseContentInternal(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
|
|||||||
xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
|
xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
|
||||||
|
|
||||||
if ((ctxt->wellFormed) ||
|
if ((ctxt->wellFormed) ||
|
||||||
((ctxt->recovery) && (ctxt->errNo != XML_ERR_NO_MEMORY))) {
|
((ctxt->recovery) && (!xmlCtxtIsCatastrophicError(ctxt)))) {
|
||||||
if (root != NULL) {
|
if (root != NULL) {
|
||||||
xmlNodePtr cur;
|
xmlNodePtr cur;
|
||||||
|
|
||||||
@@ -13836,7 +13836,7 @@ xmlCtxtParseDocument(xmlParserCtxtPtr ctxt, xmlParserInputPtr input)
|
|||||||
xmlParseDocument(ctxt);
|
xmlParseDocument(ctxt);
|
||||||
|
|
||||||
if ((ctxt->wellFormed) ||
|
if ((ctxt->wellFormed) ||
|
||||||
((ctxt->recovery) && (ctxt->errNo != XML_ERR_NO_MEMORY))) {
|
((ctxt->recovery) && (!xmlCtxtIsCatastrophicError(ctxt)))) {
|
||||||
ret = ctxt->myDoc;
|
ret = ctxt->myDoc;
|
||||||
} else {
|
} else {
|
||||||
if (ctxt->errNo == XML_ERR_OK)
|
if (ctxt->errNo == XML_ERR_OK)
|
||||||
|
|||||||
Reference in New Issue
Block a user