mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-13 13:17:36 +03:00
Non ASCII character may be split at buffer end
* HTMLparser.c: make sure when we call xmlParserInputGrow in htmlCurrentChar, to reset the current pointer
This commit is contained in:
parent
f447ab8f97
commit
8a103793f2
12
HTMLparser.c
12
HTMLparser.c
@ -384,19 +384,25 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
|
||||
|
||||
c = *cur;
|
||||
if (c & 0x80) {
|
||||
if (cur[1] == 0)
|
||||
if (cur[1] == 0) {
|
||||
xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
|
||||
cur = ctxt->input->cur;
|
||||
}
|
||||
if ((cur[1] & 0xc0) != 0x80)
|
||||
goto encoding_error;
|
||||
if ((c & 0xe0) == 0xe0) {
|
||||
|
||||
if (cur[2] == 0)
|
||||
if (cur[2] == 0) {
|
||||
xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
|
||||
cur = ctxt->input->cur;
|
||||
}
|
||||
if ((cur[2] & 0xc0) != 0x80)
|
||||
goto encoding_error;
|
||||
if ((c & 0xf0) == 0xf0) {
|
||||
if (cur[3] == 0)
|
||||
if (cur[3] == 0) {
|
||||
xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
|
||||
cur = ctxt->input->cur;
|
||||
}
|
||||
if (((c & 0xf8) != 0xf0) ||
|
||||
((cur[3] & 0xc0) != 0x80))
|
||||
goto encoding_error;
|
||||
|
Loading…
Reference in New Issue
Block a user