fix: null check on find_option_handler return value
This commit is contained in:
parent
41f3b13f91
commit
74cb08edc8
1 changed files with 2 additions and 0 deletions
|
|
@ -98,6 +98,8 @@ handle_one_option(int opt, char **argv, void *config,
|
||||||
return error_invalid_opt(current_opt);
|
return error_invalid_opt(current_opt);
|
||||||
|
|
||||||
desc = find_option_handler(opt, opts, nb_opts);
|
desc = find_option_handler(opt, opts, nb_opts);
|
||||||
|
if (NULL == desc)
|
||||||
|
return CLI_ERROR;
|
||||||
bitmask_index = (size_t)(desc - opts);
|
bitmask_index = (size_t)(desc - opts);
|
||||||
if (HAS_FLAG(*opt_tracker, (1ULL << bitmask_index)))
|
if (HAS_FLAG(*opt_tracker, (1ULL << bitmask_index)))
|
||||||
return error_duplicate_opt(current_opt);
|
return error_duplicate_opt(current_opt);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue