mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
Fix HTML parsing with 0 character in CDATA
* HTMLparser.c: 0 before the end of the input need some special case handling, raise the error and return a space instead
This commit is contained in:
@ -425,6 +425,13 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
|
|||||||
}
|
}
|
||||||
return(val);
|
return(val);
|
||||||
} else {
|
} else {
|
||||||
|
if ((*ctxt->input->cur == 0) &&
|
||||||
|
(ctxt->input->cur < ctxt->input->end)) {
|
||||||
|
htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
|
||||||
|
"Char 0x%X out of allowed range\n", 0);
|
||||||
|
*len = 1;
|
||||||
|
return(' ');
|
||||||
|
}
|
||||||
/* 1-byte code */
|
/* 1-byte code */
|
||||||
*len = 1;
|
*len = 1;
|
||||||
return((int) *ctxt->input->cur);
|
return((int) *ctxt->input->cur);
|
||||||
|
Reference in New Issue
Block a user