]> Cypherpunks.ru repositories - gostls13.git/commit
internal/zstd: avoid panic when the regenerated size is too small
authoraimuz <mr.imuz@gmail.com>
Thu, 9 Nov 2023 02:30:46 +0000 (02:30 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 9 Nov 2023 14:30:10 +0000 (14:30 +0000)
commit291ffcbea6fb8c90681d80c2d708402df00633f9
tree2c024c2cef0d5b7ec46df0005c765f2710666def
parentc1a48694530afcf9e378a234de493f9f6de6a364
internal/zstd: avoid panic when the regenerated size is too small

Description in accordance with RFC 8878 3.1.1.3.1.6.

The decompressed size of each stream is equal to (Regenerated_Size+3)/4,
except for the last stream, which may be up to 3 bytes smaller,
to reach a total decompressed size as specified in Regenerated_Size.

Fixes #63824

Change-Id: I5a8b482a995272aa2028a81a4db86c21b1770432
GitHub-Last-Rev: 76a70756bc005a8fcd33b4b6a50fd6c3bf827fb6
GitHub-Pull-Request: golang/go#63959
Reviewed-on: https://go-review.googlesource.com/c/go/+/540055
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Klaus Post <klauspost@gmail.com>
Run-TryBot: Jes Cok <xigua67damn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/internal/zstd/fuzz_test.go
src/internal/zstd/literals.go