Skip to content

Zstd fixes#23417

Merged
alexrp merged 2 commits intoziglang:masterfrom
dweiller:zstd-fixes
Mar 31, 2025
Merged

Zstd fixes#23417
alexrp merged 2 commits intoziglang:masterfrom
dweiller:zstd-fixes

Conversation

@dweiller
Copy link
Contributor

@dweiller dweiller commented Mar 31, 2025

Closes #23413.

This PR fixes an OOB access when the raw literal section in a compressed block claims it has more bytes than the buffer used to store the literals. The added test case uses a slight reduction of the input data described in #23413.

In addition, when the validating a Zstandard frame header ensure that the window size fits into a usize.

@alexrp alexrp added this to the 0.14.1 milestone Mar 31, 2025
When decoding the literals section of a compressed block, the length of
the regenerated size of the literals must be checked against the buffer
literals are decoded into.
@alexrp alexrp merged commit c118cd6 into ziglang:master Mar 31, 2025
9 checks passed
alexrp added a commit that referenced this pull request Mar 31, 2025
@dweiller dweiller deleted the zstd-fixes branch April 9, 2025 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zstandard panics on fuzzed input

2 participants