fuzz: Avoid -fsanitize=integer warnings in fuzzing harnesses
This commit is contained in:
1 parent
52d84a45e2
commit
58232e3ffb
4 files changed
+15
-6
No files matched your search
@@ -43,7 +43,10 @@ FUZZ_TARGET_INIT(pow, initialize_pow)
|
||||
current_block.nHeight = current_height;
|
||||
}
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
current_block.nTime = fixed_time + current_height * consensus_params.nPowTargetSpacing;
|
||||
const uint32_t seconds = current_height * consensus_params.nPowTargetSpacing;
|
||||
if (!AdditionOverflow(fixed_time, seconds)) {
|
||||
current_block.nTime = fixed_time + seconds;
|
||||
}
|
||||
}
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
current_block.nBits = fixed_bits;
|
||||
|
||||
Reference in new issue
Block a user