Skip to content

Commit c2316b1

Browse files
committed
Merge bitcoin#27917: fuzz: Fix implicit-integer-sign-change in wallet/fees fuzz target
faa05d1 fuzz: Fix implicit-integer-sign-change in wallet/fees fuzz target (MarcoFalke) Pull request description: This fixes a bug in the fuzz target. ``` echo 'OiAAAPr//wAAAAAAAAA=' | base64 --decode > /tmp/a UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" FUZZ=wallet_fees ./src/test/fuzz/fuzz /tmp/a ``` ``` wallet/fees.cpp:58:58: runtime error: implicit conversion from type 'unsigned int' of value 4294574080 (32-bit, unsigned) to type 'int' changed the value to -393216 (32-bit, signed) #0 0x5625ef46a094 in wallet::GetMinimumFeeRate(wallet::CWallet const&, wallet::CCoinControl const&, FeeCalculation*) src/wallet/fees.cpp:58:58 #1 0x5625eedd467f in wallet::(anonymous namespace)::wallet_fees_fuzz_target(Span<unsigned char const>) src/wallet/test/fuzz/fees.cpp:64:11 ... SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change wallet/fees.cpp:58:58 in ACKs for top commit: dergoegge: tACK faa05d1 brunoerg: ACK faa05d1 Tree-SHA512: 66a4020d6a4153a92c7023e9f94ec6279862566db7236ce3cf6951b7fbee616dc88a56fe9502de4099d74f9840439b20a984b0733fb432e43129e774bcc2a6e6
2 parents f80db62 + faa05d1 commit c2316b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wallet/test/fuzz/fees.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ FUZZ_TARGET_INIT(wallet_fees, initialize_setup)
5656
coin_control.m_feerate = CFeeRate{ConsumeMoney(fuzzed_data_provider, /*max=*/COIN)};
5757
}
5858
if (fuzzed_data_provider.ConsumeBool()) {
59-
coin_control.m_confirm_target = fuzzed_data_provider.ConsumeIntegral<unsigned int>();
59+
coin_control.m_confirm_target = fuzzed_data_provider.ConsumeIntegralInRange<unsigned int>(0, 999'000);
6060
}
6161

6262
FeeCalculation fee_calculation;

0 commit comments

Comments
 (0)