Tags: klauspost/compress
Tags
zstd: Fix corrupted output in "best" (#876) * zstd: Fix corrupted output in "best" Regression from #784 and followup #793 Fixes #875 A 0 offset backreference was possible when "improve" was successful twice in a row in the "skipBeginning" part, only finding 2 (previously unmatches) length 4 matches, but where start offset decreased by 2 in both cases. This would result in output where the end offset would equal to the next 's', thereby doing a self-reference. Add a general check in "improve" and just reject these. Will also guard against similar issues in the future. This also hints at some potentially suboptimal hash indexing - but I will take that improvement separately. Fuzz test set updated.
s2: Fix S2 best dictionary wrong encoding (#871) A dictionary match one byte out of dictionary range was possible. Recovery is possible. Send me a request if you find any content with this error in the [discussion](https://github.com/klauspost/compress/discussions/categories/general).
PreviousNext