From 88401eb553ccc95d39c0032caf4e2ddf3dfbe81a Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Fri, 30 Dec 2016 14:26:28 +0100 Subject: Fix a read-before-init bug in lexer.c. One of the branches in the lexer tested ls->last without checking ls->cc first. --- src/lexer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lexer.c b/src/lexer.c index 5610519..540160a 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -94,7 +94,7 @@ static int read_buffer(lexer_state_t *ls) ls->in_token = false; ret_token = true; } - } else if (*ls->buf_c == '/' && ls->last == '/') { + } else if (*ls->buf_c == '/' && (ls->cc && ls->last == '/')) { ls->in_comment = true; ls->in_token = false; -- cgit