mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Merge #6263: backport: Merge bitcoin/bitcoin#23064
3c51f3ab1e
Merge bitcoin/bitcoin#23064: fuzz: Fix memory leak in system fuzz target (MarcoFalke) Pull request description: Backports ACKs for top commit: UdjinM6: utACK3c51f3ab1e
knst: utACK3c51f3ab1e
Tree-SHA512: 1dc54750d0d897f272e65a25f25cd83ed21b9df02313a933286d0651c4e73c0c1c84aba643e81d33097746bde38a028c1c524f973c0f973c1555ede31f176cba
This commit is contained in:
commit
a9a2d4adbe
@ -5,6 +5,7 @@
|
|||||||
#include <test/fuzz/FuzzedDataProvider.h>
|
#include <test/fuzz/FuzzedDataProvider.h>
|
||||||
#include <test/fuzz/fuzz.h>
|
#include <test/fuzz/fuzz.h>
|
||||||
#include <test/fuzz/util.h>
|
#include <test/fuzz/util.h>
|
||||||
|
#include <test/util/setup_common.h>
|
||||||
#include <util/system.h>
|
#include <util/system.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -12,6 +13,11 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
void initialize_system()
|
||||||
|
{
|
||||||
|
static const auto testing_setup = MakeNoLogFileContext<>();
|
||||||
|
}
|
||||||
|
|
||||||
std::string GetArgumentName(const std::string& name)
|
std::string GetArgumentName(const std::string& name)
|
||||||
{
|
{
|
||||||
size_t idx = name.find('=');
|
size_t idx = name.find('=');
|
||||||
@ -20,9 +26,8 @@ std::string GetArgumentName(const std::string& name)
|
|||||||
}
|
}
|
||||||
return name.substr(0, idx);
|
return name.substr(0, idx);
|
||||||
}
|
}
|
||||||
} // namespace
|
|
||||||
|
|
||||||
FUZZ_TARGET(system)
|
FUZZ_TARGET_INIT(system, initialize_system)
|
||||||
{
|
{
|
||||||
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
|
||||||
ArgsManager args_manager{};
|
ArgsManager args_manager{};
|
||||||
@ -114,3 +119,4 @@ FUZZ_TARGET(system)
|
|||||||
|
|
||||||
(void)HelpRequested(args_manager);
|
(void)HelpRequested(args_manager);
|
||||||
}
|
}
|
||||||
|
} // namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user