[issue3367] Uninitialized value read in parsetok.c

Alexander Belopolsky report at bugs.python.org
Fri Feb 4 01:26:42 CET 2011


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

I don't have a working valgrind or purify, but I was able to reproduce the problem using a poor man's solution of adding

         assert(0xcbcbcbcbcbcbcbcb != tok->line_start);

before

         if (a >= tok->line_start)
 
With that assert the debug build indeed crashes once I hit Ctrl-D.  Attached patch fixes that. 

I have also added tok->line_start in a few tok constructors for which I don't have a test case demonstrating access to uninitialized value, but it seems to be good defensive programming.

----------
nosy: +belopolsky
Added file: http://bugs.python.org/file20668/issue3367.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3367>
_______________________________________


More information about the Python-bugs-list mailing list