-
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
Fix for zstd
CLI accepts bogus values for numeric parameters
#3268
Fix for zstd
CLI accepts bogus values for numeric parameters
#3268
Conversation
…eters Signed-off-by: Ly Cao <lycao@fb.com>
zstd
CLI accepts bogus values for numeric parameters
@@ -0,0 +1,40 @@ | |||
#!/bin/sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good tests !
👍
Indeed, the solution cannot be done directly within The I believe your fix is correct, but it's written directly to serve If you update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ctkhanhly!
Tests and logic look good.
There's one change that I'd like us to do here - there are other fields that use NEXT_UINT32
to read sizes and which use the same logic for parsing suffixes.
It'd be better to change the NEXT_UINT32
macro and so apply the same validation on those fields as well.
@ctkhanhly - if you have some time it'd also be useful to get the same treatment for the fields that directly use |
I see a remaining test issue in It looks completely unrelated to this PR. Anyway, I think you can safely ignore it, we'll deal with it separately. |
Signed-off-by: Ly Cao <lycao@fb.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you!
Thanks @ctkhanhly , great bootcamp contribution ! |
Related Issue to #3070
Notes:
readU32FromCharChecked
but this affects at leastinit_cLevel
Testing:
memlimit.sh
@yoniko