Skip to content

Commit c6de072

Browse files
committed
Merge bitcoin/bitcoin#30248: refactor: Add explicit cast to expected_last_page to silence fuzz ISan
fa9cb10 refactor: Add explicit cast to expected_last_page to silence fuzz ISan (MarcoFalke) Pull request description: Fixes #30247 I don't think this implicit cast can lead to any bugs, so make it explicit to silence the fuzz integer sanitizer. Can be tested with: ``` FUZZ=wallet_bdb_parser UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" ./src/test/fuzz/fuzz /tmp/1376869be72eebcc87fe737020add634b1a29533 ``` After downloading the raw fuzz input from https://github.com/bitcoin-core/qa-assets/blob/24c507b3ea6263e6b121fb8dced01123065c44c2/fuzz_seed_corpus/wallet_bdb_parser/1376869be72eebcc87fe737020add634b1a29533 ACKs for top commit: dergoegge: utACK fa9cb10 Tree-SHA512: 226dcc58be8d70b4eec1657f232c9c6648b5dac5eb2706e7390e65ce0a031fbaf8afce97d71a535c8294467dca4757c96f294d8cc03d5e6a1c0a036b0e070325
2 parents 2d21060 + fa9cb10 commit c6de072

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wallet/migrate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ void BerkeleyRODatabase::Open()
551551
// }
552552

553553
// Check the last page number
554-
uint32_t expected_last_page = (size / page_size) - 1;
554+
uint32_t expected_last_page{uint32_t((size / page_size) - 1)};
555555
if (outer_meta.last_page != expected_last_page) {
556556
throw std::runtime_error("Last page number could not fit in file");
557557
}

0 commit comments

Comments
 (0)