Prevent use of uninitialised variable

I don't believe the value of 'next' is actually used if it is not
set by the tokenizer, but this is very hard to prove.  For safety,
we give it a safe default value.
This commit is contained in:
Rhodri James 2017-04-25 15:15:56 +01:00 committed by Sebastian Pipping
parent 9ed727064b
commit a4dc944f37

View file

@ -5044,6 +5044,8 @@ processInternalEntity(XML_Parser parser, ENTITY *entity,
openEntity->internalEventEndPtr = NULL;
textStart = (char *)entity->textPtr;
textEnd = (char *)(entity->textPtr + entity->textLen);
/* Set a safe default value in case 'next' does not get set */
next = textStart;
#ifdef XML_DTD
if (entity->is_param) {
@ -5089,6 +5091,8 @@ internalEntityProcessor(XML_Parser parser,
entity = openEntity->entity;
textStart = ((char *)entity->textPtr) + entity->processed;
textEnd = (char *)(entity->textPtr + entity->textLen);
/* Set a safe default value in case 'next' does not get set */
next = textStart;
#ifdef XML_DTD
if (entity->is_param) {