Fix for zstd CLI accepts bogus values for numeric parameters#3268
Fix for zstd CLI accepts bogus values for numeric parameters#3268Cyan4973 merged 3 commits intofacebook:devfrom
zstd CLI accepts bogus values for numeric parameters#3268Conversation
…eters Signed-off-by: Ly Cao <[email protected]>
zstd CLI accepts bogus values for numeric parameters
| @@ -0,0 +1,40 @@ | |||
| #!/bin/sh | |||
|
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 |
yoniko
left a comment
There was a problem hiding this comment.
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 <[email protected]>
|
Thanks @ctkhanhly , great bootcamp contribution ! |
Related Issue to #3070
Notes:
readU32FromCharCheckedbut this affects at leastinit_cLevelTesting:
memlimit.sh@yoniko