[ expat-Bugs-564342 ] reading uninitialized variable
noreply@sourceforge.net
noreply@sourceforge.net
Wed Jun 12 19:24:05 2002
Bugs item #564342, was opened at 2002-06-04 08:48
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=110127&aid=564342&group_id=10127
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: David Somers (moundsmere)
>Assigned to: Karl Waclawek (kwaclaw)
Summary: reading uninitialized variable
Initial Comment:
in xmlparse.c, line 3600
eventEndPtr = next;
my debugger complains that this is causing an attempt
to read unitialized data.
----------------------------------------------------------------------
>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-06-12 22:23
Message:
Logged In: YES
user_id=3066
Closing; patch #565510 already checked in.
----------------------------------------------------------------------
Comment By: David Somers (moundsmere)
Date: 2002-06-06 16:19
Message:
Logged In: YES
user_id=36164
Patch submitted.
David.
----------------------------------------------------------------------
Comment By: Karl Waclawek (kwaclaw)
Date: 2002-06-06 16:02
Message:
Logged In: YES
user_id=290026
I propose you submit a patch! :-)
Is there anything special about the situation
when this happens (first loop iteration, ...)?
Karl
----------------------------------------------------------------------
Comment By: David Somers (moundsmere)
Date: 2002-06-06 15:56
Message:
Logged In: YES
user_id=36164
Hi Karl,
You found the place I mean. I'm referring to the file as I found
it in expat-1.95.3.tar.gz, so I guess the line numbers have
slipped somewhere.
Yep, the debugger complains because its coming across
eventEndPtr = next for a case when next hasn't been
assigned (so it doesn't like eventEndPtr being set to
garbage).
OK. It doesn't cause an actual error, per se, but its the *only*
thing that my debugger has found to complain about in Expat,
so it would be great to quash it (which is very easy: just do
const char *next = NULL; two lines before)
David
----------------------------------------------------------------------
Comment By: Karl Waclawek (kwaclaw)
Date: 2002-06-06 15:29
Message:
Logged In: YES
user_id=290026
OK, there is only one such line, but
I have it on line 3618, in xmlparse.c rev. 1.41.
Are you sure you have 1.95.3?
Anyway, the code there looks like:
...
for (;;) {
const char *next;
int tok = XmlPrologTok(encoding, s, end, &next);
eventEndPtr = next;
switch (tok) {
...
It looks as if XMLPrologTok initilaizes next, but
since this is dynamic behaviour (XMLPrologTok
is actually a function pointer), it cannot be
assumed for sure that it is happening.
Maybe that is what the debugger is complaining about?
Does this cause an actual error?
Karl
----------------------------------------------------------------------
Comment By: David Somers (moundsmere)
Date: 2002-06-06 15:17
Message:
Logged In: YES
user_id=36164
Like I said in the original message: line 3600 (eventEndPtr =
next)
Cheers,
David
----------------------------------------------------------------------
Comment By: Karl Waclawek (kwaclaw)
Date: 2002-06-06 15:13
Message:
Logged In: YES
user_id=290026
On which line?
----------------------------------------------------------------------
Comment By: David Somers (moundsmere)
Date: 2002-06-06 14:52
Message:
Logged In: YES
user_id=36164
Yes, it happends with 1.95.3 too.
----------------------------------------------------------------------
Comment By: Karl Waclawek (kwaclaw)
Date: 2002-06-06 14:43
Message:
Logged In: YES
user_id=290026
Does this happen with version 1.95.3 too?
Karl
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=110127&aid=564342&group_id=10127