mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
fixed an uninitialized memory access spotted by valgrind Daniel
* HTMLparser.c: fixed an uninitialized memory access spotted by valgrind Daniel
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
Mon Aug 8 01:41:53 CEST 2005 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* HTMLparser.c: fixed an uninitialized memory access spotted by
|
||||||
|
valgrind
|
||||||
|
|
||||||
Sun Aug 7 12:39:35 CEST 2005 Daniel Veillard <daniel@veillard.com>
|
Sun Aug 7 12:39:35 CEST 2005 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* test/relaxng/docbook_0.xml: get rid of the dependancy on a locally
|
* test/relaxng/docbook_0.xml: get rid of the dependancy on a locally
|
||||||
|
12
HTMLparser.c
12
HTMLparser.c
@@ -2743,6 +2743,8 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nbchar != 0) {
|
if (nbchar != 0) {
|
||||||
|
buf[nbchar] = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ok the segment is to be consumed as chars.
|
* Ok the segment is to be consumed as chars.
|
||||||
*/
|
*/
|
||||||
@@ -5176,10 +5178,18 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
|
|||||||
(ctxt->input->buf != NULL) && (ctxt->instate != XML_PARSER_EOF)) {
|
(ctxt->input->buf != NULL) && (ctxt->instate != XML_PARSER_EOF)) {
|
||||||
int base = ctxt->input->base - ctxt->input->buf->buffer->content;
|
int base = ctxt->input->base - ctxt->input->buf->buffer->content;
|
||||||
int cur = ctxt->input->cur - ctxt->input->base;
|
int cur = ctxt->input->cur - ctxt->input->base;
|
||||||
|
int res;
|
||||||
|
|
||||||
xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
|
res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
|
||||||
|
if (res < 0) {
|
||||||
|
ctxt->errNo = XML_PARSER_EOF;
|
||||||
|
ctxt->disableSAX = 1;
|
||||||
|
return (XML_PARSER_EOF);
|
||||||
|
}
|
||||||
ctxt->input->base = ctxt->input->buf->buffer->content + base;
|
ctxt->input->base = ctxt->input->buf->buffer->content + base;
|
||||||
ctxt->input->cur = ctxt->input->base + cur;
|
ctxt->input->cur = ctxt->input->base + cur;
|
||||||
|
ctxt->input->end =
|
||||||
|
&ctxt->input->buf->buffer->content[ctxt->input->buf->buffer->use];
|
||||||
#ifdef DEBUG_PUSH
|
#ifdef DEBUG_PUSH
|
||||||
xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);
|
xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user