holiman / billy

Very simple datastore
BSD 3-Clause "New" or "Revised" License
50 stars 7 forks source link

shelf: fix overflow-to-zero on corrupt data #24

Closed holiman closed 4 months ago

holiman commented 4 months ago

@karalabe added a nice fuzzer. After running it a while, I hit the overflow which this PR fixes. The overflow can happen when the size-field of a blob of data, added to the itemheadersize, wraps around to 0.

This PR addresses it by doing the addition in uint64-space instead of uint32-space.