* grub-core/net/bootp.c (grub_cmd_bootp): Check if there is any card

present.
	* include/grub/err.h (grub_err_t): New enum value GRUB_ERR_NET_NO_CARD.
This commit is contained in:
Paulo Flabiano Smorigo 2013-05-11 11:25:29 +02:00 committed by Vladimir 'phcoder' Serbinenko
parent 709ad61b07
commit a9c0b699c0
3 changed files with 10 additions and 0 deletions

View file

@ -447,6 +447,9 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)),
ncards++;
}
if (ncards == 0)
return grub_error (GRUB_ERR_NET_NO_CARD, N_("no network card found"));
ifaces = grub_zalloc (ncards * sizeof (ifaces[0]));
if (!ifaces)
return grub_errno;