mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
fuzz: Avoid OOM in system fuzz target
This commit is contained in:
parent
d67330d112
commit
fa7718344d
2 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,9 @@
|
|||
#include <functional>
|
||||
#include <string_view>
|
||||
|
||||
#define LIMITED_WHILE(condition, limit) \
|
||||
for (unsigned _count{limit}; (condition) && _count; --_count)
|
||||
|
||||
using FuzzBufferType = Span<const uint8_t>;
|
||||
|
||||
using TypeTestOneInput = std::function<void(FuzzBufferType)>;
|
||||
|
|
|
@ -31,7 +31,8 @@ FUZZ_TARGET(system)
|
|||
SetupHelpOptions(args_manager);
|
||||
}
|
||||
|
||||
while (fuzzed_data_provider.ConsumeBool()) {
|
||||
LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 3000)
|
||||
{
|
||||
CallOneOf(
|
||||
fuzzed_data_provider,
|
||||
[&] {
|
||||
|
|
Loading…
Add table
Reference in a new issue