net/bootp: Fix unchecked return value
PATCH 1/1 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 <[email protected]>
--- grub-core/net/bootp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
grub-core/net/bootp.c +3 -1
@@ -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 );
Signature · 1 line
2.27.0
Quoted 6 lines · Alec Brown
In the function
send_dhcp_packet(), added an error check for the return value ofgrub_netbuff_push().Fixes CID 404614Signed-off-by Alec Brown <[email protected]>
Reviewed-by Daniel Kiper <[email protected]>
Daniel