mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
fixed bug #381877, avoid reading over the end of stream when generating an
* HTMLparser.c: fixed bug #381877, avoid reading over the end of stream when generating an UTF-8 encoding error. Daniel svn path=/trunk/; revision=3627
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Tue Jun 12 10:37:42 CEST 2007 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* HTMLparser.c: fixed bug #381877, avoid reading over the end
|
||||||
|
of stream when generating an UTF-8 encoding error.
|
||||||
|
|
||||||
Tue Jun 12 10:16:48 CEST 2007 Daniel Veillard <daniel@veillard.com>
|
Tue Jun 12 10:16:48 CEST 2007 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* parser.c: fixed bug #366161, trivially added the check in
|
* parser.c: fixed bug #366161, trivially added the check in
|
||||||
|
10
HTMLparser.c
10
HTMLparser.c
@ -401,9 +401,13 @@ encoding_error:
|
|||||||
{
|
{
|
||||||
char buffer[150];
|
char buffer[150];
|
||||||
|
|
||||||
snprintf(buffer, 149, "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
|
if (ctxt->input->end - ctxt->input->cur >= 4) {
|
||||||
ctxt->input->cur[0], ctxt->input->cur[1],
|
snprintf(buffer, 149, "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
|
||||||
ctxt->input->cur[2], ctxt->input->cur[3]);
|
ctxt->input->cur[0], ctxt->input->cur[1],
|
||||||
|
ctxt->input->cur[2], ctxt->input->cur[3]);
|
||||||
|
} else {
|
||||||
|
snprintf(buffer, 149, "Bytes: 0x%02X\n", ctxt->input->cur[0]);
|
||||||
|
}
|
||||||
htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
|
htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
|
||||||
"Input is not proper UTF-8, indicate encoding !\n",
|
"Input is not proper UTF-8, indicate encoding !\n",
|
||||||
BAD_CAST buffer, NULL);
|
BAD_CAST buffer, NULL);
|
||||||
|
Reference in New Issue
Block a user