Commit d2ff0394 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

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
parent 8b2c7f10
Fri Nov 22 13:26:19 CET 2002 Daniel Veillard <daniel@veillard.com>
* 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.
Fri Nov 22 13:13:00 HKT 2002 William Brack <wbrack@mmm.com.hk>
* threads.c: fixed initialization problem in xmlNewGlobalState
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment