-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
spec: 0-sized compressed blocks permitted by spec #3090
Comments
Interesting, we have a |
Thanks for the report! We'll fix this bug in the next release. We've had other bugs in the decoder that rejected valid frames. I will put up a PR shortly with a document that lists all the known cases where we've rejected a valid frame, an example frame, and the version we fixed the issue. |
Actually, this block used to be invalid. Older versions of the spec had this clause:
We removed that clause because the decoder didn't enforce it. And because it made certain topics (namely block splitting) a lot simpler. Since there are cases where you'd want to emit a small block that had large headers, but you'd then re-use those headers in later blocks to amortize the cost. However, it looks like we missed the edge case where compressed block is 0 sized. |
That explains why it wasn't part of |
This frame is the simplest test case. The only difference from the one you provided is that yours has the
|
The one liner fix is to change However, that definitely breaks some bounds checks in |
See #3092 for the decompressor errata document. |
@terrelln So I think @Cyan4973 Yeah, the input is from fuzz testing, so I am not surprised there are some wonky bits in there :) |
@klauspost |
Describe the bug
The current decompression code fails if the remainder of a block is sent to the literal decoder with only 2 bytes.
With 0 literals and 0 sequences that condition can be met.
While it is easy to argue that a block with such encoding is pointless (it should just be a raw block), I don't see any mention of it in the spec, and as far as I can tell it is conforming to spec. Ofc. I might have missed it.
Example: 2274d31e0d569fe9e31bedc4f9fddd9c9f114c2f.zst.gz
The text was updated successfully, but these errors were encountered: