1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-28 00:21:53 +03:00

fixing bug #99190 when UTF8 document are parsed using the progressive

* parserInternals.c: fixing bug #99190 when UTF8 document are
  parsed using the progressive parser and the end of the chunk
  is in the middle of an UTF8 multibyte character.
Daniel
This commit is contained in:
Daniel Veillard
2002-11-22 12:28:38 +00:00
parent 8b2c7f10f1
commit d2ff0394f8
2 changed files with 16 additions and 0 deletions

View File

@ -1348,6 +1348,16 @@ xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
}
return((int) *ctxt->input->cur);
encoding_error:
/*
* An encoding problem may arise from a truncated input buffer
* splitting a character in the middle. In that case do not raise
* an error but return 0 to endicate an end of stream problem
*/
if (ctxt->input->end - ctxt->input->cur < 4) {
*len = 0;
return(0);
}
/*
* If we detect an UTF8 error that probably mean that the
* input encoding didn't get properly advertised in the