mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04: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
1 changed files with 1 additions and 2 deletions
|
|
@ -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 a new issue