Skip to content

Commit 8351562

Browse files
committed
[fuzz] allow negative time jumps in txdownloadman_impl
1 parent 917ab81 commit 8351562

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/fuzz/txdownloadman.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,9 @@ FUZZ_TARGET(txdownloadman_impl, .init = initialize)
430430
}
431431
);
432432

433-
// Jump ahead in time
434-
time += fuzzed_data_provider.PickValueInArray(TIME_SKIPS);
433+
auto time_skip = fuzzed_data_provider.PickValueInArray(TIME_SKIPS);
434+
if (fuzzed_data_provider.ConsumeBool()) time_skip *= -1;
435+
time += time_skip;
435436
CheckInvariants(txdownload_impl, max_orphan_count);
436437
}
437438
// Disconnect everybody, check that all data structures are empty.

0 commit comments

Comments
 (0)