net/bootp: Fix unchecked return value

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>
This commit is contained in:
Alec Brown 2023-02-03 17:18:14 -05:00 committed by Daniel Kiper
parent 65bc459630
commit 4f7d77d7e0

View 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);