mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-14 08:20:36 +00:00
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:
parent
9ed727064b
commit
a4dc944f37
1 changed files with 4 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue