summaryrefslogtreecommitdiff
path: root/Parser/tokenizer.c
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2008-08-05 01:38:08 +0000
committerAndrew M. Kuchling <amk@amk.ca>2008-08-05 01:38:08 +0000
commitefa61bc15f325bb94d147b8641031d1774fb7a5c (patch)
tree421fbc846042116d4fceff54233c8d45a01cf58a /Parser/tokenizer.c
parent10288e19bf09ae79923794ed50da60af7eb5e3a1 (diff)
downloadcpython-git-efa61bc15f325bb94d147b8641031d1774fb7a5c.tar.gz
#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.
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r--Parser/tokenizer.c2
1 files changed, 1 insertions, 1 deletions
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;