diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2012-05-16 14:01:33 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2012-05-16 14:01:33 +0000 |
commit | 827480cfbcdf0d4e90435b34906b30126a4c744b (patch) | |
tree | 04ccbc0f24b6a0556b6118aa7f2b654f46d3b96d /usr.bin | |
parent | 9d2c13f774880eb7967becefacc501c2ed9daaf3 (diff) |
Add missing break between AF_INET and AF_INET6 in addr_matches_if_netmask()
Addresses CVE 2012-2337
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/sudo/match.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/sudo/match.c b/usr.bin/sudo/match.c index 35bc119e20b..98fa713c807 100644 --- a/usr.bin/sudo/match.c +++ b/usr.bin/sudo/match.c @@ -630,7 +630,7 @@ addr_matches_if(n) ifp = &interfaces[i]; if (ifp->family != family) continue; - switch(family) { + switch (family) { case AF_INET: if (ifp->addr.ip4.s_addr == addr.s_addr || (ifp->addr.ip4.s_addr & ifp->netmask.ip4.s_addr) @@ -648,6 +648,7 @@ addr_matches_if(n) } if (j == sizeof(addr6.s6_addr)) return(TRUE); + break; #endif } } @@ -710,10 +711,11 @@ addr_matches_if_netmask(n, m) ifp = &interfaces[i]; if (ifp->family != family) continue; - switch(family) { + switch (family) { case AF_INET: if ((ifp->addr.ip4.s_addr & mask.s_addr) == addr.s_addr) return(TRUE); + break; #ifdef HAVE_IN6_ADDR case AF_INET6: for (j = 0; j < sizeof(addr6.s6_addr); j++) { @@ -722,6 +724,7 @@ addr_matches_if_netmask(n, m) } if (j == sizeof(addr6.s6_addr)) return(TRUE); + break; #endif /* HAVE_IN6_ADDR */ } } |