#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.
This commit is contained in:
parent
10288e19bf
commit
efa61bc15f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue