mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
fuzz: replace every fuzzer-controlled loop with a LIMITED_WHILE loop
Blindly chose a cap of 10000 iterations for every loop, except for the two in script_ops.cpp and scriptnum_ops.cpp which appeared to (sometimes) be deserializing individual bytes; capped those to one million to ensure that sometimes we try working with massive scripts. There was also one fuzzer-controlled loop in timedata.cpp which was already capped, so I left that alone. git grep 'while (fuzz' should now run clean except for timedata.cpp
This commit is contained in:
parent
22a9018649
commit
214d9055ac
29 changed files with 34 additions and 34 deletions
|
|
@ -199,7 +199,7 @@ FUZZ_TARGET_INIT(versionbits, initialize)
|
|||
const uint32_t signalling_mask = fuzzed_data_provider.ConsumeIntegral<uint32_t>();
|
||||
|
||||
// mine prior periods
|
||||
while (fuzzed_data_provider.remaining_bytes() > 0) {
|
||||
while (fuzzed_data_provider.remaining_bytes() > 0) { // early exit; no need for LIMITED_WHILE
|
||||
// all blocks in these periods either do or don't signal
|
||||
bool signal = fuzzed_data_provider.ConsumeBool();
|
||||
for (int b = 0; b < period; ++b) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue