1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

error: Limit number of parser errors

Reporting errors is expensive and some abusive test cases can generate
an error for each invalid input byte. This causes the parser to spend
most of the time with error handling. Limit the number of errors and
warnings to 100.
This commit is contained in:
Nick Wellnhofer
2022-12-27 14:15:51 +01:00
parent ba910d344f
commit 59b3366178
5 changed files with 44 additions and 6 deletions

View File

@ -6790,6 +6790,11 @@ htmlCtxtReset(htmlParserCtxtPtr ctxt)
xmlHashFree(ctxt->attsSpecial, NULL);
ctxt->attsSpecial = NULL;
}
ctxt->nbErrors = 0;
ctxt->nbWarnings = 0;
if (ctxt->lastError.code != XML_ERR_OK)
xmlResetError(&ctxt->lastError);
}
/**