fix: null check on find_option_handler return value
This commit is contained in:
parent
a7dd6bde3b
commit
f91ed23cb0
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);
|
||||
|
||||
desc = find_option_handler(opt, opts, nb_opts);
|
||||
if (NULL == desc)
|
||||
return CLI_ERROR;
|
||||
bitmask_index = (size_t)(desc - opts);
|
||||
if (HAS_FLAG(*opt_tracker, (1ULL << bitmask_index)))
|
||||
return error_duplicate_opt(current_opt);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue