mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
parser: Recover more input from encoding errors
Don't halt the parser in xmlParserGrow to allow more input to be recovered in case of encoding errors. Fixes #543.
This commit is contained in:
@@ -411,9 +411,11 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
|
||||
return(ctxt->token);
|
||||
}
|
||||
|
||||
if ((ctxt->input->end - ctxt->input->cur < INPUT_CHUNK) &&
|
||||
(xmlParserGrow(ctxt) < 0))
|
||||
return(0);
|
||||
if (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK) {
|
||||
xmlParserGrow(ctxt);
|
||||
if (ctxt->instate == XML_PARSER_EOF)
|
||||
return(0);
|
||||
}
|
||||
|
||||
if (ctxt->charset != XML_CHAR_ENCODING_UTF8) {
|
||||
xmlChar * guess;
|
||||
|
||||
Reference in New Issue
Block a user