From: Andrei Borzenkov Date: Sun, 20 Mar 2016 07:32:33 +0000 (+0300) Subject: bootp: check that interface is not NULL in configure_by_dhcp_ack X-Git-Tag: 2.02-rc1~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6714d7ecffe58021760e4d1ebfa9cc3473f7fb24;p=thirdparty%2Fgrub.git bootp: check that interface is not NULL in configure_by_dhcp_ack grub_net_add_addr may fail with OOM and we use returned interface later without any checks. --- diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index 09c6f7606..189551a48 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -157,6 +157,9 @@ grub_net_configure_by_dhcp_ack (const char *name, hwaddr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; inter = grub_net_add_addr (name, card, &addr, &hwaddr, flags); + if (!inter) + return 0; + #if 0 /* This is likely based on misunderstanding. gateway_ip refers to address of BOOTP relay and should not be used after BOOTP transaction