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
This commit is contained in:
Pawel Jakub Dawidek 2010-08-16 21:59:56 +00:00
parent c913de0e06
commit 471bb09914
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=211407

View File

@ -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);