mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-24 19:21:38 +01:00
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:
parent
c913de0e06
commit
471bb09914
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=211407
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user