mirror of
https://git.tukaani.org/xz.git
synced 2025-11-02 22:42:55 +00:00
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
(cherry picked from commit 52ff32433734d03befd85a5bf00fba77d6501455)
This commit is contained in:
parent
4ddf32c92b
commit
9b5a5c39f4
@ -275,17 +275,17 @@ parse_real(args_info *args, int argc, char **argv)
|
||||
{ "best", no_argument, NULL, '9' },
|
||||
|
||||
// Filters
|
||||
{ "filters", optional_argument, NULL, OPT_FILTERS},
|
||||
{ "filters1", optional_argument, NULL, OPT_FILTERS1},
|
||||
{ "filters2", optional_argument, NULL, OPT_FILTERS2},
|
||||
{ "filters3", optional_argument, NULL, OPT_FILTERS3},
|
||||
{ "filters4", optional_argument, NULL, OPT_FILTERS4},
|
||||
{ "filters5", optional_argument, NULL, OPT_FILTERS5},
|
||||
{ "filters6", optional_argument, NULL, OPT_FILTERS6},
|
||||
{ "filters7", optional_argument, NULL, OPT_FILTERS7},
|
||||
{ "filters8", optional_argument, NULL, OPT_FILTERS8},
|
||||
{ "filters9", optional_argument, NULL, OPT_FILTERS9},
|
||||
{ "filters-help", optional_argument, NULL, OPT_FILTERS_HELP},
|
||||
{ "filters", required_argument, NULL, OPT_FILTERS},
|
||||
{ "filters1", required_argument, NULL, OPT_FILTERS1},
|
||||
{ "filters2", required_argument, NULL, OPT_FILTERS2},
|
||||
{ "filters3", required_argument, NULL, OPT_FILTERS3},
|
||||
{ "filters4", required_argument, NULL, OPT_FILTERS4},
|
||||
{ "filters5", required_argument, NULL, OPT_FILTERS5},
|
||||
{ "filters6", required_argument, NULL, OPT_FILTERS6},
|
||||
{ "filters7", required_argument, NULL, OPT_FILTERS7},
|
||||
{ "filters8", required_argument, NULL, OPT_FILTERS8},
|
||||
{ "filters9", required_argument, NULL, OPT_FILTERS9},
|
||||
{ "filters-help", no_argument, NULL, OPT_FILTERS_HELP},
|
||||
|
||||
{ "lzma1", optional_argument, NULL, OPT_LZMA1 },
|
||||
{ "lzma2", optional_argument, NULL, OPT_LZMA2 },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user