[Python-checkins] r65539 - python/trunk/Parser/tokenizer.c

andrew.kuchling python-checkins at python.org
Tue Aug 5 03:38:08 CEST 2008


Author: andrew.kuchling
Date: Tue Aug  5 03:38:08 2008
New Revision: 65539

Log:
#3367 from Kristjan Valur Jonsson:
If a PyTokenizer_FromString() is called with an empty string, the 
tokenizer's line_start member never gets initialized.  Later, it is 
compared with the token pointer 'a' in parsetok.c:193 and that behavior 
can result in undefined behavior.


Modified:
   python/trunk/Parser/tokenizer.c

Modified: python/trunk/Parser/tokenizer.c
==============================================================================
--- python/trunk/Parser/tokenizer.c	(original)
+++ python/trunk/Parser/tokenizer.c	Tue Aug  5 03:38:08 2008
@@ -1117,7 +1117,7 @@
 	register int c;
 	int blankline;
 
-	*p_start = *p_end = NULL;
+	tok->line_start = *p_start = *p_end = NULL;
   nextline:
 	tok->start = NULL;
 	blankline = 0;


More information about the Python-checkins mailing list