Add error verification in netbuff operations.

This commit is contained in:
Manoel R. Abranches 2011-06-18 20:20:53 -03:00
parent d6d205568f
commit d855fbcf37
7 changed files with 38 additions and 19 deletions

View file

@ -85,7 +85,10 @@ grub_err_t
grub_net_recv_ip_packets (struct grub_net_buff *nb)
{
struct iphdr *iph = (struct iphdr *) nb->data;
grub_netbuff_pull (nb, sizeof (*iph));
grub_err_t err;
if ((err = grub_netbuff_pull (nb, sizeof (*iph))) != GRUB_ERR_NONE)
return err;
switch (iph->protocol)
{