1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +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:
Daniel Veillard 2005-08-07 23:42:39 +00:00
parent 336a8e13bf
commit d2755a8134
2 changed files with 16 additions and 1 deletions

View File

@ -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>
* test/relaxng/docbook_0.xml: get rid of the dependancy on a locally

View File

@ -2743,6 +2743,8 @@ htmlParseCharData(htmlParserCtxtPtr ctxt) {
}
}
if (nbchar != 0) {
buf[nbchar] = 0;
/*
* 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)) {
int base = ctxt->input->base - ctxt->input->buf->buffer->content;
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->cur = ctxt->input->base + cur;
ctxt->input->end =
&ctxt->input->buf->buffer->content[ctxt->input->buf->buffer->use];
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);
#endif