summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/inet_network.c
diff options
context:
space:
mode:
authormpp <mpp@FreeBSD.org>1996-02-17 21:11:36 +0000
committermpp <mpp@FreeBSD.org>1996-02-17 21:11:36 +0000
commit8b115c5fc51ae95cdef8f4bf8747a4ee347850ad (patch)
tree7a6e844dcd9de5a820277286d2d87c641d9fbd56 /lib/libc/net/inet_network.c
parente41a58821e3e7a96624060a9f6f03c47e4e71329 (diff)
downloadFreeBSD-src-8b115c5fc51ae95cdef8f4bf8747a4ee347850ad.zip
FreeBSD-src-8b115c5fc51ae95cdef8f4bf8747a4ee347850ad.tar.gz
Fix inet_network to not dump core if passed in an address
with more than 4 octets (e.g. 1.2.3.4.5). Submitted by: Amy Baron <amee@beer.org> via NetBSD-bugs
Diffstat (limited to 'lib/libc/net/inet_network.c')
-rw-r--r--lib/libc/net/inet_network.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libc/net/inet_network.c b/lib/libc/net/inet_network.c
index fda53b6..c3a96a6 100644
--- a/lib/libc/net/inet_network.c
+++ b/lib/libc/net/inet_network.c
@@ -74,7 +74,7 @@ again:
break;
}
if (*cp == '.') {
- if (pp >= parts + 4)
+ if (pp >= parts + 3)
return (INADDR_NONE);
*pp++ = val, cp++;
goto again;
@@ -83,8 +83,6 @@ again:
return (INADDR_NONE);
*pp++ = val;
n = pp - parts;
- if (n > 4)
- return (INADDR_NONE);
for (val = 0, i = 0; i < n; i++) {
val <<= 8;
val |= parts[i] & 0xff;
OpenPOWER on IntegriCloud