]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
net/bootp: Fix unchecked return value
authorAlec Brown <alec.r.brown@oracle.com>
Fri, 3 Feb 2023 22:18:14 +0000 (17:18 -0500)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 14 Feb 2023 14:35:16 +0000 (15:35 +0100)
In the function send_dhcp_packet(), added an error check for the return
value of grub_netbuff_push().

Fixes: CID 404614
Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/net/bootp.c

index 7d31dba970a8ec834e115e2e791a1d7197a8ad2e..abe45ef7bf653259412b7da83f3675af70ecd123 100644 (file)
@@ -583,7 +583,9 @@ send_dhcp_packet (struct grub_net_network_level_interface *iface)
 
   grub_memcpy (&pack->mac_addr, &iface->hwaddress.mac, 6);
 
-  grub_netbuff_push (nb, sizeof (*udph));
+  err = grub_netbuff_push (nb, sizeof (*udph));
+  if (err)
+    goto out;
 
   udph = (struct udphdr *) nb->data;
   udph->src = grub_cpu_to_be16_compile_time (68);