I agree. I was going to ask steps to reproduce then I noticed this is unused.
vasild
commented at 1:37 pm on November 22, 2024:
contributor
Such a test is in #28584 which adds a call to CConnman::SocketHandler() and CConnman::InitBinds() during fuzzing. CConnman::InitBinds() will add some listening sockets and from there:
brunoerg
commented at 1:32 pm on November 25, 2024:
contributor
So, it would be better to cherry-pick this into #28584?
vasild
commented at 11:07 am on November 26, 2024:
contributor
Hmm, to have it included in #28584 - yes, I should do that. But also to have it standalone here because this is fixing a bug in master and shouldn’t be tied to the fate of #28584.
bitcoin deleted a comment
on Nov 26, 2024
vasild
commented at 2:33 pm on November 28, 2024:
contributor
Leaving this open for an independent review/merge because it is smaller change and fixes a problem in master.
fuzz: set the output argument of FuzzedSock::Accept()
`FuzzedSock::Accept()` properly returns a new socket, but it forgot to
set the output argument `addr`, like `accept(2)` is expected to.
This could lead to reading uninitialized data during testing when we
read it, e.g. from `CService::SetSockAddr()` which reads the `sa_family`
member.
Set `addr` to a fuzzed IPv4 or IPv6 address.
83199523c9
vasild force-pushed
on Dec 10, 2024
vasild
commented at 10:14 am on December 10, 2024:
contributor
7e28f6d0dd...83199523c9: copy less bytes from the returned vector if ConsumeBytes() returns less, ie don’t copy from past the end of the returned vector. It is ok to leave some of addr4->sin_addr during this copy because we have memset the entire to 0 earlier.
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2025-10-10 21:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me