Skip to content

zstd: Protect against index out-of-bounds when decoding sequences#24871

Merged
andrewrk merged 1 commit into
ziglang:masterfrom
squeek502:zstd-index-oob
Aug 16, 2025
Merged

zstd: Protect against index out-of-bounds when decoding sequences#24871
andrewrk merged 1 commit into
ziglang:masterfrom
squeek502:zstd-index-oob

Conversation

@squeek502

@squeek502 squeek502 commented Aug 16, 2025

Copy link
Copy Markdown
Member

Previously, index out-of-bounds could occur when copying match_length bytes while decoding whatever sequence happened to overflow dest. Now, each sequence checks that there is enough room for the full sequence_length (literal_length + match_length) before doing any copying.

Fixes the failing inputs found here: #24817 (comment)

Closes #24817

Previously, index out-of-bounds could occur when copying match_length bytes while decoding whatever sequence happened to overflow `dest`. Now, each sequence checks that there is enough room for the full sequence_length (literal_length + match_length) before doing any copying.

Fixes the failing inputs found here: ziglang#24817 (comment)
@andrewrk andrewrk enabled auto-merge (rebase) August 16, 2025 01:54
@andrewrk andrewrk disabled auto-merge August 16, 2025 05:11
@andrewrk andrewrk merged commit 9854771 into ziglang:master Aug 16, 2025
11 of 14 checks passed
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.

zstd decompression regressions (fuzz test results)

2 participants