nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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