Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Fix binary.Uvarint overflow. #13

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions snappy/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ func decodedLen(src []byte) (blockLen, headerLen int, err error) {
if n == 0 {
return 0, 0, ErrCorrupt
}
if n < 0 {
return 0, 0, errors.New("snappy: value larger than 64 bits (overflow)")
}
if uint64(int(v)) != v {
return 0, 0, errors.New("snappy: decoded block is too large")
}
Expand Down