Fix crash when empty address from DNS overlays A record from hosts.

This commit is contained in:
Edwin Török
2015-11-14 17:45:48 +00:00
committed by Simon Kelley
parent 90477fb794
commit 41a8d9e99b
2 changed files with 6 additions and 1 deletions

View File

@@ -13,6 +13,11 @@ version 2.76
was a dangling symbolic link, even of --no-resolv set.
Thanks to Alexander Kurtz for spotting the problem.
Fix crash when an A or AAAA record is defined locally,
in a hosts file, and an upstream server sends a reply
that the same name is empty. Thanks to Edwin Török for
the patch.
version 2.75
Fix reversion on 2.74 which caused 100% CPU use when a

View File

@@ -481,7 +481,7 @@ struct crec *cache_insert(char *name, struct all_addr *addr,
existing record is for an A or AAAA and
the record we're trying to insert is the same,
just drop the insert, but don't error the whole process. */
if ((flags & (F_IPV4 | F_IPV6)) && (flags & F_FORWARD))
if ((flags & (F_IPV4 | F_IPV6)) && (flags & F_FORWARD) && addr)
{
if ((flags & F_IPV4) && (new->flags & F_IPV4) &&
new->addr.addr.addr.addr4.s_addr == addr->addr.addr4.s_addr)