diff options
author | merge-script <fanquake@gmail.com> | 2024-06-20 09:52:57 +0100 |
---|---|---|
committer | merge-script <fanquake@gmail.com> | 2024-06-20 09:52:57 +0100 |
commit | aa2ce2d64696c030fb39f4e63b12271bb700eb28 (patch) | |
tree | fd565f657c637c31fc8e6c5606f292f21294f907 /src | |
parent | c6de072a215e8f893098abbab74e0ac1267c3f8b (diff) | |
parent | fa7bc9bbca9348cf31b97bee0789ea7caeec635c (diff) |
Merge bitcoin/bitcoin#30307: fuzz: Fix wallet_bdb_parser 32-bit unhandled fseek error
fa7bc9bbca9348cf31b97bee0789ea7caeec635c fuzz: Fix wallet_bdb_parser 32-bit unhandled fseek error (MarcoFalke)
Pull request description:
`std::fseek` on 64-bit past the end of the file may work fine (the following read would fail). However, on 32-bit it may fail early.
Fix it, by ignoring the error, treating it similar to a read error.
This was found by OSS-Fuzz.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=69414
ACKs for top commit:
TheCharlatan:
ACK fa7bc9bbca9348cf31b97bee0789ea7caeec635c
brunoerg:
utACK fa7bc9bbca9348cf31b97bee0789ea7caeec635c
Tree-SHA512: 7a752a005837bae6846ce315a7b3b1a5fe1f440c7797c750f2c0bbb20b1ef1537cd390c425747c0c85d012655e2f908bd300ea084f82e5ada19badbf826e1ec9
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/test/fuzz/wallet_bdb_parser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet/test/fuzz/wallet_bdb_parser.cpp b/src/wallet/test/fuzz/wallet_bdb_parser.cpp index 5216e09769..6fbd695fc5 100644 --- a/src/wallet/test/fuzz/wallet_bdb_parser.cpp +++ b/src/wallet/test/fuzz/wallet_bdb_parser.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023 The Bitcoin Core developers +// Copyright (c) 2023-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -63,6 +63,7 @@ FUZZ_TARGET(wallet_bdb_parser, .init = initialize_wallet_bdb_parser) #endif if (error.original.starts_with("AutoFile::ignore: end of file") || error.original.starts_with("AutoFile::read: end of file") || + error.original.starts_with("AutoFile::seek: ") || error.original == "Not a BDB file" || error.original == "Unexpected page type, should be 9 (BTree Metadata)" || error.original == "Unexpected database flags, should only be 0x20 (subdatabases)" || |