diff --git a/ChangeLog b/ChangeLog index 9488c1da3..6376fa086 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-06-21 Vladimir Serbinenko + + * 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 * grub-core/net/bootp.c (grub_cmd_bootp): Fix packet allocation size. diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c index d0b391aa1..3381ea7ce 100644 --- a/grub-core/net/dns.c +++ b/grub-core/net/dns.c @@ -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) diff --git a/grub-core/net/net.c b/grub-core/net/net.c index 924de2a7d..28ec09ad4 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -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) {