Blame SOURCES/0427-script-execute-Fix-NULL-dereference-in-grub_script_e.patch

468bd4
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
468bd4
From: Daniel Axtens <dja@axtens.net>
468bd4
Date: Fri, 3 Apr 2020 23:05:13 +1100
468bd4
Subject: [PATCH] script/execute: Fix NULL dereference in
468bd4
 grub_script_execute_cmdline()
468bd4
468bd4
Signed-off-by: Daniel Axtens <dja@axtens.net>
468bd4
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
468bd4
---
468bd4
 grub-core/script/execute.c | 2 +-
468bd4
 1 file changed, 1 insertion(+), 1 deletion(-)
468bd4
468bd4
diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c
468bd4
index a1aadb9ee05..2e47c046741 100644
468bd4
--- a/grub-core/script/execute.c
468bd4
+++ b/grub-core/script/execute.c
468bd4
@@ -978,7 +978,7 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd)
468bd4
   struct grub_script_argv argv = { 0, 0, 0 };
468bd4
 
468bd4
   /* Lookup the command.  */
468bd4
-  if (grub_script_arglist_to_argv (cmdline->arglist, &argv) || ! argv.args[0])
468bd4
+  if (grub_script_arglist_to_argv (cmdline->arglist, &argv) || ! argv.args || ! argv.args[0])
468bd4
     return grub_errno;
468bd4
 
468bd4
   for (i = 0; i < argv.argc; i++) {