about summary refs log tree commit diff
path: root/inet/inet_net.c
diff options
context:
space:
mode:
Diffstat (limited to 'inet/inet_net.c')
-rw-r--r--inet/inet_net.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/inet/inet_net.c b/inet/inet_net.c
index 78d22cda6b..e9331c5926 100644
--- a/inet/inet_net.c
+++ b/inet/inet_net.c
@@ -83,6 +83,8 @@ again:
 	}
 	if (*cp && !isspace(*cp))
 		return (INADDR_NONE);
+	if (pp >= parts + 4 || val > 0xff)
+		return (INADDR_NONE);
 	*pp++ = val;
 	n = pp - parts;
 	for (val = 0, i = 0; i < n; i++) {