Replace check for ">= HOST_NAME_MAX+1" with "> HOST_NAME_MAX".
authormillert <millert@openbsd.org>
Fri, 16 Jan 2015 18:10:31 +0000 (18:10 +0000)
committermillert <millert@openbsd.org>
Fri, 16 Jan 2015 18:10:31 +0000 (18:10 +0000)
OK deraadt@

lib/libc/net/ruserok.c

index fed55e0..eed76d9 100644 (file)
@@ -245,7 +245,7 @@ __ivaliduser_sa(FILE *hostf, struct sockaddr *raddr, socklen_t salen,
                auser = *user ? user : luser;
                ahost = buf;
 
-               if (strlen(ahost) >= HOST_NAME_MAX+1)
+               if (strlen(ahost) > HOST_NAME_MAX)
                        continue;
 
                /*