From 3c7079670dfa210b4134649aba5dcc5d2a0d40ca Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 28 Aug 2010 15:35:43 +0200 Subject: [PATCH] * grub-core/script/lexer.c (grub_script_lexer_init): Don't look before the begining of the string --- ChangeLog | 5 +++++ grub-core/script/lexer.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2ffbbcd7b..612669367 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-08-28 Vladimir Serbinenko + + * grub-core/script/lexer.c (grub_script_lexer_init): Don't look before + the begining of the string + 2010-08-28 Vladimir Serbinenko * grub-core/script/script.c (grub_script_parse): Free parsed on diff --git a/grub-core/script/lexer.c b/grub-core/script/lexer.c index 42a570348..64da45ed8 100644 --- a/grub-core/script/lexer.c +++ b/grub-core/script/lexer.c @@ -236,7 +236,7 @@ grub_script_lexer_init (struct grub_parser_param *parser, char *script, script = script ? : "\n"; len = grub_strlen (script); - if (script[len - 1] == '\n') + if (len != 0 && script[len - 1] == '\n') { buffer = yy_scan_string (script, lexerstate->yyscanner); }