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

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