Commit efa61bc1 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

#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.
parent 10288e19
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment