Skip to content

Commit 400eb7a

Browse files
author
andrew.kuchling
committed
#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. git-svn-id: http://svn.python.org/projects/python/trunk@65539 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 9a99755 commit 400eb7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Parser/tokenizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
11171117
register int c;
11181118
int blankline;
11191119

1120-
*p_start = *p_end = NULL;
1120+
tok->line_start = *p_start = *p_end = NULL;
11211121
nextline:
11221122
tok->start = NULL;
11231123
blankline = 0;

0 commit comments

Comments
 (0)