From 471bb0991423f373bb0cacd5c8a4e64f90305583 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Mon, 16 Aug 2010 21:59:56 +0000 Subject: [PATCH] The 'size' variable is there to limit how many bytes we want to copy from 'addr'. It is very likely that size of 'addr' is larger than 'size', so checking strlcpy() return value is bogus. MFC after: 3 weeks --- sbin/hastd/proto_tcp4.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sbin/hastd/proto_tcp4.c b/sbin/hastd/proto_tcp4.c index 8415872d8019..bfbae8c1c1e0 100644 --- a/sbin/hastd/proto_tcp4.c +++ b/sbin/hastd/proto_tcp4.c @@ -156,8 +156,7 @@ tcp4_addr(const char *addr, struct sockaddr_in *sinp) size = (size_t)(pp - addr + 1); if (size > sizeof(iporhost)) return (ENAMETOOLONG); - if (strlcpy(iporhost, addr, size) >= size) - return (ENAMETOOLONG); + (void)strlcpy(iporhost, addr, size); } /* Convert string (IP address or host name) to in_addr_t. */ ip = str2ip(iporhost);