nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0137-Fix-const-char-pointers-in-grub-core-net-efi-ip4_con.patch

8e15ce
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8e15ce
From: Peter Jones <pjones@redhat.com>
8e15ce
Date: Mon, 20 Jul 2020 12:24:02 -0400
8e15ce
Subject: [PATCH] Fix const char ** pointers in grub-core/net/efi/ip4_config.c
8e15ce
8e15ce
This will need to get folded back in the right place on the next rebase,
8e15ce
but it's before "Make grub_strtol() "end" pointers have safer const
8e15ce
qualifiers" currently, so for now I'm leaving it here instead of merging
8e15ce
it back with the original patch.
8e15ce
8e15ce
Signed-off-by: Peter Jones <pjones@redhat.com>
8e15ce
---
8e15ce
 grub-core/net/efi/ip4_config.c | 5 +++--
8e15ce
 1 file changed, 3 insertions(+), 2 deletions(-)
8e15ce
8e15ce
diff --git a/grub-core/net/efi/ip4_config.c b/grub-core/net/efi/ip4_config.c
b35c50
index 9725e928f7..cb880fc3e8 100644
8e15ce
--- a/grub-core/net/efi/ip4_config.c
8e15ce
+++ b/grub-core/net/efi/ip4_config.c
8e15ce
@@ -61,7 +61,8 @@ int
8e15ce
 grub_efi_string_to_ip4_address (const char *val, grub_efi_ipv4_address_t *address, const char **rest)
8e15ce
 {
8e15ce
   grub_uint32_t newip = 0;
8e15ce
-  int i, ncolon = 0;
8e15ce
+  grub_size_t i;
8e15ce
+  int ncolon = 0;
8e15ce
   const char *ptr = val;
8e15ce
 
8e15ce
   /* Check that is not an IPv6 address */
8e15ce
@@ -78,7 +79,7 @@ grub_efi_string_to_ip4_address (const char *val, grub_efi_ipv4_address_t *addres
8e15ce
   for (i = 0; i < 4; i++)
8e15ce
     {
8e15ce
       unsigned long t;
8e15ce
-      t = grub_strtoul (ptr, (char **) &ptr, 0);
8e15ce
+      t = grub_strtoul (ptr, &ptr, 0);
8e15ce
       if (grub_errno)
8e15ce
 	{
8e15ce
 	  grub_errno = GRUB_ERR_NONE;