Skip to content

Commit

Permalink
Merge pull request #141 from DataDog/sfluor-patch-1
Browse files Browse the repository at this point in the history
Update upperBound ratio when guessing the required decompression buffer size
  • Loading branch information
sfluor authored Jun 28, 2024
2 parents 869dae0 + e75a26a commit beb4dfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zstd.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func cCompressBound(srcSize int) int {
// decompressSizeHint tries to give a hint on how much of the output buffer size we should have
// based on zstd frame descriptors. To prevent DOS from maliciously-created payloads, limit the size
func decompressSizeHint(src []byte) int {
// 1 MB or 10x input size
upperBound := 10 * len(src)
// 1 MB or 50x input size
upperBound := 50 * len(src)
if upperBound < decompressSizeBufferLimit {
upperBound = decompressSizeBufferLimit
}
Expand Down

0 comments on commit beb4dfd

Please sign in to comment.