Commit f14246bc authored by Chen Wei's avatar Chen Wei

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

parent 137dcbc9
...@@ -481,7 +481,7 @@ struct crec *cache_insert(char *name, struct all_addr *addr, ...@@ -481,7 +481,7 @@ struct crec *cache_insert(char *name, struct all_addr *addr,
existing record is for an A or AAAA and existing record is for an A or AAAA and
the record we're trying to insert is the same, the record we're trying to insert is the same,
just drop the insert, but don't error the whole process. */ 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) && if ((flags & F_IPV4) && (new->flags & F_IPV4) &&
new->addr.addr.addr.addr4.s_addr == addr->addr.addr4.s_addr) new->addr.addr.addr.addr4.s_addr == addr->addr.addr4.s_addr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment