diff options
author | ume <ume@FreeBSD.org> | 2008-12-14 19:39:53 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2008-12-14 19:39:53 +0000 |
commit | 5981f7a689e7291656f30b6c8e94a05339c101b0 (patch) | |
tree | 5e14eb7d469e63a149e56aedf1a74b40e820e7cd /lib/libc/inet | |
parent | d6c5fd3f81862801cb66bf464744657a24a2d4e2 (diff) | |
download | FreeBSD-src-5981f7a689e7291656f30b6c8e94a05339c101b0.zip FreeBSD-src-5981f7a689e7291656f30b6c8e94a05339c101b0.tar.gz |
Merge the resolver part of BIND 9.4.3 into HEAD.
It includes the following fix:
2426. [bug] libbind: inet_net_pton() can sometimes return the
wrong value if excessively large netmasks are
supplied. [RT #18512]
Reported by: Maksymilian Arciemowicz <cxib__at__securityreason.com>
Diffstat (limited to 'lib/libc/inet')
-rw-r--r-- | lib/libc/inet/inet_net_pton.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/inet/inet_net_pton.c b/lib/libc/inet/inet_net_pton.c index 06d1da9..74df38b9 100644 --- a/lib/libc/inet/inet_net_pton.c +++ b/lib/libc/inet/inet_net_pton.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.1 2005/04/27 05:00:53 sra Exp $"; +static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.2 2008/08/26 04:42:43 marka Exp $"; #endif #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -135,11 +135,11 @@ inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) { assert(n >= 0 && n <= 9); bits *= 10; bits += n; + if (bits > 32) + goto enoent; } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch)); if (ch != '\0') goto enoent; - if (bits > 32) - goto emsgsize; } /* Firey death and destruction unless we prefetched EOS. */ |