zstd icon indicating copy to clipboard operation
zstd copied to clipboard

`zstd` CLI accepts bogus values for numeric parameters

Open Svetlitski-FB opened this issue 3 years ago • 1 comments

Describe the bug

CLI parameters which are intended to accept numerical values (including those which take on optional suffix to denote the magnitude of the value) do not check that the values passed are well-formed.

To reproduce

For example, try running the lastest version of zstd as shown below:

zstd --memory=32LB file.txt

Expected behavior

I expected for zstd to reject the value passed for --memory since "LB" isn't a meaningful unit (perhaps the user made a typo and intended to say "KB"). This issue extends to even further malformed inputs, for instance the below example is also accepted without raising an error:

zstd --memory=hello file.txt

Svetlitski-FB avatar Feb 18 '22 22:02 Svetlitski-FB

because no one believes me when I ask others to help. I also lose track of things like this. I apologize to everyone. Thank you very much for what you did from the beginning. I will try to study them. I'm really sorry.

52541 avatar Feb 28 '22 10:02 52541

Fixed in #3268

Cyan4973 avatar Sep 21 '22 20:09 Cyan4973