mirror of https://git.tukaani.org/xz.git
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:9ded880a02
Fixes:d6af7f3470
Fixes:a165d7df19
This commit is contained in:
parent
2655c81b5e
commit
52ff324337
|
@ -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…
Reference in New Issue