Blame SOURCES/0246-bootp-check-that-interface-is-not-NULL-in-configure_.patch

d41074
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a85e8e
From: Andrei Borzenkov <arvidjaar@gmail.com>
a85e8e
Date: Sun, 20 Mar 2016 10:32:33 +0300
d41074
Subject: [PATCH] bootp: check that interface is not NULL in
a85e8e
 configure_by_dhcp_ack
a85e8e
a85e8e
grub_net_add_addr may fail with OOM and we use returned interface
a85e8e
later without any checks.
a85e8e
---
a85e8e
 grub-core/net/bootp.c | 3 +++
a85e8e
 1 file changed, 3 insertions(+)
a85e8e
a85e8e
diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c
d41074
index 62d602d9645..7df7f55110e 100644
a85e8e
--- a/grub-core/net/bootp.c
a85e8e
+++ b/grub-core/net/bootp.c
a85e8e
@@ -237,6 +237,9 @@ grub_net_configure_by_dhcp_ack (const char *name,
a85e8e
   hwaddr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET;
a85e8e
 
a85e8e
   inter = grub_net_add_addr (name, card, &addr, &hwaddr, flags);
a85e8e
+  if (!inter)
a85e8e
+    return 0;
a85e8e
+
a85e8e
 #if 0
a85e8e
   /* This is likely based on misunderstanding. gateway_ip refers to
a85e8e
      address of BOOTP relay and should not be used after BOOTP transaction