mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
[midx] Fix an undefined behavior (left-shift signed overflow)
There was a missing check to ensure that the `off64_t` (which is a signed value) didn't overflow when parsing it from the midx file. This shouldn't have huge repercusions since the parsed value is immediately validated afterwards, but then again, there is no such thing as "benign" undefined behavior. This change makes all the bitwise arithmetic happen with unsigned types and is only casted to `off64_t` until the very end. Thanks to Taotao Gu for finding and reporting this!
This commit is contained in:
BIN
fuzzers/corpora/midx/666a779eed16847c6930a71c0547a34e52db409e
Normal file
BIN
fuzzers/corpora/midx/666a779eed16847c6930a71c0547a34e52db409e
Normal file
Binary file not shown.
Reference in New Issue
Block a user