diff --git a/ChangeLog b/ChangeLog index c2031b19..b20c98e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jun 13 17:30:25 CEST 2002 Daniel Veillard + + * parser.c: removed an uninitialized data error popped by valgrind + on PE references + Wed Jun 12 21:38:46 MDT 2002 John Fleck * doc/xml.html diff --git a/parser.c b/parser.c index f5827e05..fa0dd4a3 100644 --- a/parser.c +++ b/parser.c @@ -899,13 +899,15 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { * plug some encoding conversion routines. */ GROW - start[0] = RAW; - start[1] = NXT(1); - start[2] = NXT(2); - start[3] = NXT(3); - enc = xmlDetectCharEncoding(start, 4); - if (enc != XML_CHAR_ENCODING_NONE) { - xmlSwitchEncoding(ctxt, enc); + if (entity->length >= 4) { + start[0] = RAW; + start[1] = NXT(1); + start[2] = NXT(2); + start[3] = NXT(3); + enc = xmlDetectCharEncoding(start, 4); + if (enc != XML_CHAR_ENCODING_NONE) { + xmlSwitchEncoding(ctxt, enc); + } } if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&