Skip to content

zstd CLI accepts bogus values for numeric parameters #3070

@ghost

Description

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions