nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0474-misc-Format-string-for-grub_error-should-be-a-litera.patch

d18179
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d18179
From: Glenn Washburn <development@efficientek.com>
d18179
Date: Thu, 4 Mar 2021 18:22:32 -0600
d18179
Subject: [PATCH] misc: Format string for grub_error() should be a literal
d18179
d18179
Signed-off-by: Glenn Washburn <development@efficientek.com>
d18179
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
d18179
(cherry-picked from commit 60875f4e15d704b875969b415501802b531c4db3)
d18179
(cherry picked from commit 9103b9e99e3541dea7a131cb1fbfb904c2ab249e)
d18179
---
d18179
 grub-core/loader/efi/chainloader.c | 2 +-
d18179
 grub-core/net/tftp.c               | 2 +-
d18179
 grub-core/script/lexer.c           | 2 +-
d18179
 3 files changed, 3 insertions(+), 3 deletions(-)
d18179
d18179
diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c
d18179
index 3185a7a1c2..bfb4aa34cb 100644
d18179
--- a/grub-core/loader/efi/chainloader.c
d18179
+++ b/grub-core/loader/efi/chainloader.c
d18179
@@ -79,7 +79,7 @@ grub_start_image (grub_efi_handle_t handle)
d18179
 	      *grub_utf16_to_utf8 ((grub_uint8_t *) buf,
d18179
 				   exit_data, exit_data_size) = 0;
d18179
 
d18179
-	      grub_error (GRUB_ERR_BAD_OS, buf);
d18179
+	      grub_error (GRUB_ERR_BAD_OS, "%s", buf);
d18179
 	      grub_free (buf);
d18179
 	    }
d18179
 	}
d18179
diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c
d18179
index 85be965470..69a9ba6979 100644
d18179
--- a/grub-core/net/tftp.c
d18179
+++ b/grub-core/net/tftp.c
d18179
@@ -253,7 +253,7 @@ tftp_receive (grub_net_udp_socket_t sock __attribute__ ((unused)),
d18179
     case TFTP_ERROR:
d18179
       data->have_oack = 1;
d18179
       grub_netbuff_free (nb);
d18179
-      grub_error (GRUB_ERR_IO, (char *) tftph->u.err.errmsg);
d18179
+      grub_error (GRUB_ERR_IO, "%s", tftph->u.err.errmsg);
d18179
       grub_error_save (&data->save_err);
d18179
       return GRUB_ERR_NONE;
d18179
     default:
d18179
diff --git a/grub-core/script/lexer.c b/grub-core/script/lexer.c
d18179
index 1c8bca0a32..71d0acf9d4 100644
d18179
--- a/grub-core/script/lexer.c
d18179
+++ b/grub-core/script/lexer.c
d18179
@@ -349,7 +349,7 @@ void
d18179
 grub_script_yyerror (struct grub_parser_param *state, char const *err)
d18179
 {
d18179
   if (err)
d18179
-    grub_error (GRUB_ERR_INVALID_COMMAND, err);
d18179
+    grub_error (GRUB_ERR_INVALID_COMMAND, "%s", err);
d18179
 
d18179
   grub_print_error ();
d18179
   state->err++;