* grub-core/net/drivers/emu/emunet.c (get_card_packet): Allocate the

reserved bytes.
	* grub-core/net/drivers/i386/pc/pxe.c (grub_pxe_recv): Likewise.
	* grub-core/net/drivers/ieee1275/ofnet.c (get_card_packet): Likewise.
	Handle malloc error correctly.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-06-21 22:05:41 +02:00
parent cde393c9a3
commit 531e2241a6
4 changed files with 15 additions and 6 deletions

View file

@ -213,7 +213,7 @@ grub_pxe_recv (struct grub_net_card *dev __attribute__ ((unused)))
grub_pxe_call (GRUB_PXENV_UNDI_ISR, isr, pxe_rm_entry);
}
buf = grub_netbuff_alloc (isr->frame_len);
buf = grub_netbuff_alloc (isr->frame_len + 2);
if (!buf)
return NULL;
/* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible