]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/script/lexer.c (grub_script_lexer_init): Don't look before
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 28 Aug 2010 13:35:43 +0000 (15:35 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 28 Aug 2010 13:35:43 +0000 (15:35 +0200)
the begining of the string

ChangeLog
grub-core/script/lexer.c

index 2ffbbcd7bcb01bdf5f319c709746b0680870c019..612669367d63af475bf667993441941a2b773f76 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-28  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/script/lexer.c (grub_script_lexer_init): Don't look before
+       the begining of the string
+
 2010-08-28  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/script/script.c (grub_script_parse): Free parsed on
index 42a570348081544f196e1015aeae843a5e38c34f..64da45ed8cd30e805db7f9da92e5733b8f00b1f5 100644 (file)
@@ -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);
     }