grub2/0100-Don-t-use-dynamic-sized-arrays-since-we-don-t-build-.patch
Javier Martinez Canillas 1f092caba7
Drop two efinet patches that were causing issues and a bunch of other fixes
Add comments and revert logic changes in 01_fallback_counting
Remove quotes when reading ID value from /etc/os-release
  Related: rhbz#1650706
blscfg: expand grub_users before passing to grub_normal_add_menu_entry()
  Resolves: rhbz#1650706
Drop buggy downstream patch "efinet: retransmit if our device is busy"
  Resolves: rhbz#1649048
Make the menu entry users option argument to be optional
  Related: rhbz#1652434
10_linux_bls: add missing menu entries options
  Resolves: rhbz#1652434
Drop "Be more aggro about actually using the *configured* network device."
  Resolves: rhbz#1654388
Fix menu entry selection based on title
  Resolves: rhbz#1654936

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-12-01 03:28:36 +01:00

43 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 26 Jun 2017 12:42:57 -0400
Subject: [PATCH] Don't use dynamic sized arrays since we don't build with
-std=c99
---
grub-core/net/net.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/grub-core/net/net.c b/grub-core/net/net.c
index 4be228d9576..fa3e2912643 100644
--- a/grub-core/net/net.c
+++ b/grub-core/net/net.c
@@ -1853,14 +1853,25 @@ grub_net_search_configfile (char *config)
{
/* By the Client UUID. */
- char client_uuid_var[sizeof ("net_") + grub_strlen (inf->name) +
- sizeof ("_clientuuid") + 1];
- grub_snprintf (client_uuid_var, sizeof (client_uuid_var),
+ char *client_uuid_var;
+ grub_size_t client_uuid_var_size;
+
+ client_uuid_var_size = grub_snprintf (NULL, 0,
+ "net_%s_clientuuid", inf->name);
+ if (client_uuid_var_size <= 0)
+ continue;
+ client_uuid_var_size += 1;
+ client_uuid_var = grub_malloc(client_uuid_var_size);
+ if (!client_uuid_var)
+ continue;
+ grub_snprintf (client_uuid_var, client_uuid_var_size,
"net_%s_clientuuid", inf->name);
const char *client_uuid;
client_uuid = grub_env_get (client_uuid_var);
+ grub_free(client_uuid_var);
+
if (client_uuid)
{
grub_strcpy (suffix, client_uuid);