From efa61bc15f325bb94d147b8641031d1774fb7a5c Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Tue, 5 Aug 2008 01:38:08 +0000 Subject: [PATCH] #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. --- Parser/tokenizer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 1d0a4aa3f2..73ff92a199 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -1117,7 +1117,7 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end) register int c; int blankline; - *p_start = *p_end = NULL; + tok->line_start = *p_start = *p_end = NULL; nextline: tok->start = NULL; blankline = 0; -- 2.40.0