]> git.ipfire.org Git - thirdparty/xz.git/commit
xz: Fix getopt_long argument type in --filters*
authorLasse Collin <lasse.collin@tukaani.org>
Sun, 5 Jan 2025 09:40:34 +0000 (11:40 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Sun, 5 Jan 2025 09:41:40 +0000 (11:41 +0200)
commit52ff32433734d03befd85a5bf00fba77d6501455
treed44337e41c3afb5ed052331eca569c75492c6aa7
parent2655c81b5e92278b0fd51f6537c1116f8349b02a
xz: Fix getopt_long argument type in --filters*

Forgetting the argument (or not using = to separate the option from
the argument) resulted in lzma_str_to_filters() being called with NULL
as input string argument. The function handles it fine but xz passes
the NULL to printf() too:

    $ xz --filters
    xz: Error in --filters=FILTERS option:
    xz: (null)
    xz: ^
    xz: Unexpected NULL pointer argument(s) to lzma_str_to_filters()

Now it's correct:

    $ xz --filters
    xz: option '--filters' requires an argument

The --filters-help option doesn't take any arguments.

Fixes: 9ded880a0221f4d1256845fc4ab957ffd377c760
Fixes: d6af7f347077b22403133239592e478931307759
Fixes: a165d7df1964121eb9df715e6f836a31c865beef
src/xz/args.c