[issue3367] Uninitialized value read in parsetok.c

Kristján Valur Jónsson report at bugs.python.org
Mon Mar 26 11:54:52 CEST 2012


Kristján Valur Jónsson <kristjan at ccpgames.com> added the comment:

I don't quite understand what you're saying about line mismatch Victor.
Anyway, if you look at it, it is clear that:
1) sys_update_path() can be called with argc==0 (main.c line 647)
2) 1742 was always setting arg0 to argv[0] that is undefined and this access may cause a crash if 1) above is true
3) line 1812 assumes n to be equal to the length of arg0, but depending on conditional compilation, it may not get set at all, and in any case, in line line 1805 it gets set only if p is not NULL.

I think it is simply safer to make the proper assumptions.

----------

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


More information about the Python-bugs-list mailing list