summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2012-05-16 14:01:32 +0000
committermillert <millert@openbsd.org>2012-05-16 14:01:32 +0000
commitbba6748ecc7bc317e1a7a7fc58b9d73c8a79abbf (patch)
treea8ec54b0c6a526af333fcbe4bcf3d9c95f0e023b
parentThe PCIe link speed values are printed in GT/s not Gb/s. (diff)
downloadwireguard-openbsd-bba6748ecc7bc317e1a7a7fc58b9d73c8a79abbf.tar.xz
wireguard-openbsd-bba6748ecc7bc317e1a7a7fc58b9d73c8a79abbf.zip
Add missing break between AF_INET and AF_INET6 in addr_matches_if_netmask()
Addresses CVE 2012-2337
-rw-r--r--usr.bin/sudo/match.c7
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 */
}
}