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

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