From ac45692a53a1b8d2ede329d91652d43c1fb5dc8d Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 12 Dec 2013 04:18:34 +0000 Subject: remove an unnecessary check in inet_pton at most 4 hexadecimal digits are processed in one field so the value cannot overflow. the netdb.h header was not used. --- src/network/inet_pton.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/network/inet_pton.c') diff --git a/src/network/inet_pton.c b/src/network/inet_pton.c index f840dd44..4496b47b 100644 --- a/src/network/inet_pton.c +++ b/src/network/inet_pton.c @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -46,7 +45,7 @@ int inet_pton(int af, const char *restrict s, void *restrict a0) } for (v=j=0; j<4 && (d=hexval(s[j]))>=0; j++) v=16*v+d; - if (j==0 || v > 65535) return 0; + if (j==0) return 0; ip[i] = v; if (!s[j] && (brk>=0 || i==7)) break; if (i==7) return 0; -- cgit v1.2.1