#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:
Andrew M. Kuchling 2008-08-05 01:38:08 +00:00
parent 10288e19bf
commit efa61bc15f
1 changed files with 1 additions and 1 deletions

View File

@ -1117,7 +1117,7 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
register int c; register int c;
int blankline; int blankline;
*p_start = *p_end = NULL; tok->line_start = *p_start = *p_end = NULL;
nextline: nextline:
tok->start = NULL; tok->start = NULL;
blankline = 0; blankline = 0;