Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seekable hang fix #2516

Merged
merged 2 commits into from
Mar 3, 2021
Merged

Seekable hang fix #2516

merged 2 commits into from
Mar 3, 2021

Conversation

senhuang42
Copy link
Contributor

This PR prevents the issue described in #2506 of seekable decompression hanging.

ZSTD_seekable_decompress() may get stuck re-decompressing the input in an infinite loop (see line 451: targetFrame = ZSTD_seekable_offsetToFrameIndex(zs, zs->decompressedOffset);). I'm not aware of any valid reason to decompress more input than actually exists for seekable decompression in a single ZSTD_seekable_decompress() call, so we should check that we aren't reading too much input.

Thanks @mlindsay for discovering issue!

Test Plan:

  • New test passes with PR (and fails without)
  • Manual roundtrip testing with examples in seekable_format/examples
    • We'll want to add a fuzzer and maybe some more unit tests in the future so that we can test changes better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants