diff options
author | Richard Genoud <richard.genoud@gmail.com> | 2014-09-17 21:17:39 +0100 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2014-09-17 21:17:39 +0100 |
commit | 10cfc0ddb35d8e7d19bdb86240a49004980b1ff8 (patch) | |
tree | 15d1b4bf31d09b19ee07f0d7f6a8912f7486db5c /src/auth.c | |
parent | 15b1b7e9c330c2a746718c288550960450c01863 (diff) | |
download | dnsmasq-10cfc0ddb35d8e7d19bdb86240a49004980b1ff8.tar.gz |
Fix length->netmask conversions to avoid undefined behaviour.
Diffstat (limited to 'src/auth.c')
-rw-r--r-- | src/auth.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -31,7 +31,7 @@ static struct addrlist *find_subnet(struct auth_zone *zone, int flag, struct all if (!(flag & F_IPV4)) continue; - netmask.s_addr = htonl(~((1 << (32 - subnet->prefixlen)) - 1)); + netmask.s_addr = htonl(~(in_addr_t)0 << (32 - subnet->prefixlen)); if (is_same_net(addr, subnet->addr.addr.addr4, netmask)) return subnet; |