[ expat-Patches-565510 ] reading uninitialized variable

noreply@sourceforge.net noreply@sourceforge.net
Wed Jun 12 12:52:03 2002


Patches item #565510, was opened at 2002-06-06 16:16
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=310127&aid=565510&group_id=10127

Category: None
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: David Somers (moundsmere)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: reading uninitialized variable

Initial Comment:
Somewhere within xmlparse.c there is the snippet:

...
  for (;;) {
    const char *next;
    int tok = XmlPrologTok(encoding, s, end, &next);
    eventEndPtr = next;
    switch (tok) {
...

(Somewhere being line 3600 in expat-1.95.3.tar.gz, or 
3618 according to kwaclaw).

Anyhow, my debugger warns that in some cases 
eventEndPtr is being assigned to an uninitialized ptr... to 
stop this happening, change:

   const char *next;

to

   const char *next = NULL;

Cheers,

David.



----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-06-12 15:51

Message:
Logged In: YES 
user_id=3066

Closing as accepted since Karl's already checked in the fix.
 ;-)

----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2002-06-06 16:51

Message:
Logged In: YES 
user_id=290026

Assigned to Fred, since he is our NULL specialist. ;-)

Karl

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=310127&aid=565510&group_id=10127