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.
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.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | TheCharlatan, brunoerg |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Example:
0$ base64 ~/Downloads/clusterfuzz-testcase-minimized-wallet_bdb_parser-5937261974716416
1ICD//yAgICAAAAAAAAUxYgAAAAkAAAIAAAkgICAgICAAAAAAICAgICAgICAgICAgAAAAIP//ICAg
2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICD/ICAgICAg////////ICAgICAgICAgICAg
3ICAgICAgICAgICAgICAgICAgICAgICAg////ICD//yAgICAgICAgICAgICAgICAgICAg////////
4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg////ICAgICAgICAgICAgICAgICAg
5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIP///yAgICAg
6ICAgICAg////IP//////ICAgICAgICAg//8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
7ICAgICAgICAgICAgICAgICAgICD///8g//////8gICAgICAgICD//yAgICAgICAgICAgICAgICAg
8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg////ICAgIP//IP//////ICAgICAg
9ICAg//8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA=
To test locally:
0CONFIG_SITE="$PWD/depends/i686-pc-linux-gnu/share/config.site" ./configure --enable-fuzz --with-sanitizers=fuzzer && make clean && make -j $(nproc)
1FUZZ=wallet_bdb_parser ./src/test/fuzz/fuzz -runs=1 /tmp/c
Before:
0terminate called after throwing an instance of 'std::runtime_error'
1 what(): AutoFile::seek: fseek failed: iostream error
After:
(Passes)
maflcko
DrahtBot
TheCharlatan
brunoerg
Labels
Tests