diff options
author | pjd <pjd@FreeBSD.org> | 2010-08-16 21:59:56 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-08-16 21:59:56 +0000 |
commit | 46021d25faf14947261c8989b53abf19c428d871 (patch) | |
tree | b84152656f7cf8f9b69f77a7277eaa371fccca6f /sbin | |
parent | 7186d2782d6bfb78a501ea6184cda0786ac89920 (diff) | |
download | FreeBSD-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.c | 3 |
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); |