mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 11:27:28 -03:00
fuzz: change FuzzedSock::GetSockName() to always fully set the output
It would be somewhat broken OS if `getsockname()` returns `0` (success) and returns `sa_family` as `AF_INET` and only sets e.g. 2 bytes in the output.
This commit is contained in:
parent
33d6a80c92
commit
72ff6d2b50
1 changed files with 3 additions and 1 deletions
|
@ -376,7 +376,9 @@ int FuzzedSock::GetSockName(sockaddr* name, socklen_t* name_len) const
|
|||
SetFuzzedErrNo(m_fuzzed_data_provider, getsockname_errnos);
|
||||
return -1;
|
||||
}
|
||||
*name_len = m_fuzzed_data_provider.ConsumeData(name, *name_len);
|
||||
std::memcpy(name,
|
||||
ConsumeFixedLengthByteVector(m_fuzzed_data_provider, *name_len).data(),
|
||||
*name_len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue