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:
@ -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
|
||||
|
Reference in New Issue
Block a user