* grub-core/net/dns.c (grub_cmd_nslookup): Init addresses to 0 to avoid

freeing random buffer on failure.
	* grub-core/net/net.c (grub_net_resolve_address): Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-06-21 22:11:47 +02:00
parent 44a0efc180
commit 418f45abd1
3 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2012-06-21 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/net/dns.c (grub_cmd_nslookup): Init addresses to 0 to avoid
freeing random buffer on failure.
* grub-core/net/net.c (grub_net_resolve_address): Likewise.
2012-06-21 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/net/bootp.c (grub_cmd_bootp): Fix packet allocation size.

View file

@ -605,7 +605,7 @@ grub_cmd_nslookup (struct grub_command *cmd __attribute__ ((unused)),
{
grub_err_t err;
grub_size_t naddresses, i;
struct grub_net_network_level_address *addresses;
struct grub_net_network_level_address *addresses = 0;
if (argc != 2 && argc != 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected"));
if (argc == 2)

View file

@ -503,7 +503,7 @@ grub_net_resolve_address (const char *name,
const char *rest;
grub_err_t err;
grub_size_t naddresses;
struct grub_net_network_level_address *addresses;
struct grub_net_network_level_address *addresses = 0;
if (parse_ip (name, &addr->ipv4, &rest) && *rest == 0)
{