dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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