[issue3367] Uninitialized value read in parsetok.c

Kristján Valur Jónsson report at bugs.python.org
Mon Mar 26 13:35:05 CEST 2012


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

I'm sure you didn't intend to use words such as "wrong" and "useless" Victor.  Perhaps n must be 0 even for argc>0, but I did that as an afterthought. Which is the reason I asked you to take a look rather than committing this right away.

Please allow me to point out that relying on an extra NULL pointer at the end of argv is dangerous.  C makes no such guarantees with main() and you are coupling implementation details betweeen layers using this.  The "correct" thing to do is to simply not dereference argv at argc or beyond.

----------

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


More information about the Python-bugs-list mailing list