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

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