-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
No check if Reserved of Symbol_Compression_Modes is 0 #3821
Comments
We don't guarantee to reject all possible invalid frames. However this is an easy case, and would make making use of this bit in the future easier. So we should definitely do this. |
So the implementation here for zstd should ignore this bit check, is that right? |
There are 2 "special" bits in the frame header :
I was almost certain that the |
@Cyan4973 What I think you are referring to is the |
Yeah, if these bits are non-zero, the frame is invalid. A compliant decoder may reject this frame. Unlike the We will update the standard decoder to reject frames that set these bits. |
@terrelln @Cyan4973 Maybe having an For example having a bit that would signify "this block does not use repeat offsets from previous block", could be a very useful "additional information" bit - and since it isn't a breaking change older versions could just ignore it. I don't want to de-rail on whether this specific bit should be added here. Just that having an ignored bit could be valuable. It would however be changing the behavior currently specified in the documentation. |
That's indeed one of the scenarios considered for the But note that we have only reserved space for this bit at Btw, it's a reasonably good idea, |
I tried to submit a patch, I'm not familiar with C. I hope it works! |
Describe the bug
According to the https://datatracker.ietf.org/doc/html/rfc8878#name-symbol_compression_modes description, Reserved should have to be 0, in which case the following file should not be able to be extracted
test-diverge-855c1b40.zst.zip
Using educational_decoder gives the expected error, but using the zstd binary does not.
use educational_decoder
./harness test-diverge-855c1b40.zst test-diverge-855c1b40 Error: Corruption detected while decompressing
use zstd
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots and charts
If applicable, add screenshots and charts to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: