summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-08-16 21:59:56 +0000
committerpjd <pjd@FreeBSD.org>2010-08-16 21:59:56 +0000
commit46021d25faf14947261c8989b53abf19c428d871 (patch)
treeb84152656f7cf8f9b69f77a7277eaa371fccca6f /sbin
parent7186d2782d6bfb78a501ea6184cda0786ac89920 (diff)
downloadFreeBSD-src-46021d25faf14947261c8989b53abf19c428d871.zip
FreeBSD-src-46021d25faf14947261c8989b53abf19c428d871.tar.gz
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
Diffstat (limited to 'sbin')
-rw-r--r--sbin/hastd/proto_tcp4.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/hastd/proto_tcp4.c b/sbin/hastd/proto_tcp4.c
index 8415872..bfbae8c 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);
OpenPOWER on IntegriCloud