grub2/grub-core/script
Daniel Axtens 0a05f88e2b script/execute: Don't crash on a "for" loop with no items
The following crashes the parser:

  for x in; do
  0
  done

This is because grub_script_arglist_to_argv() doesn't consider the
possibility that arglist is NULL. Catch that explicitly.

This avoids a NULL pointer dereference.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-03-02 15:54:17 +01:00
..
argv.c malloc: Use overflow checking primitives where we do complex allocations 2020-07-29 16:55:47 +02:00
execute.c script/execute: Don't crash on a "for" loop with no items 2021-03-02 15:54:17 +01:00
function.c script: Avoid a use-after-free when redefining a function during execution 2020-07-29 16:55:48 +02:00
lexer.c lexer: char const * should be const char * 2020-09-18 22:31:30 +02:00
main.c Remove nested functions from script reading and parsing. 2013-01-15 12:03:25 +00:00
parser.y script: Do not allow a delimiter between function name and block start 2020-09-18 22:31:30 +02:00
script.c Remove nested functions from script reading and parsing. 2013-01-15 12:03:25 +00:00
yylex.l yylex: Make lexer fatal errors actually be fatal 2020-07-29 16:55:47 +02:00