mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-14 02:41:34 +02:00
fuzz: Fix uninitialized read in test
This commit is contained in:
parent
1a7dec77f6
commit
33333755f2
@ -7,6 +7,14 @@
|
|||||||
#include <util/rbf.h>
|
#include <util/rbf.h>
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
|
|
||||||
|
bool FuzzedSock::Wait(std::chrono::milliseconds timeout, Event requested, Event* occurred ) const
|
||||||
|
{
|
||||||
|
if (!m_fuzzed_data_provider.ConsumeBool()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (occurred) *occurred = 0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void FillNode(FuzzedDataProvider& fuzzed_data_provider, CNode& node, bool init_version) noexcept
|
void FillNode(FuzzedDataProvider& fuzzed_data_provider, CNode& node, bool init_version) noexcept
|
||||||
{
|
{
|
||||||
|
@ -738,12 +738,10 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Wait(std::chrono::milliseconds timeout, Event requested, Event* occurred = nullptr) const override
|
bool Wait(std::chrono::milliseconds timeout, Event requested, Event* occurred = nullptr) const override;
|
||||||
{
|
|
||||||
return m_fuzzed_data_provider.ConsumeBool();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsConnected(std::string& errmsg) const override {
|
bool IsConnected(std::string& errmsg) const override
|
||||||
|
{
|
||||||
if (m_fuzzed_data_provider.ConsumeBool()) {
|
if (m_fuzzed_data_provider.ConsumeBool()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user