]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_indications: Fix indications remove command autocomplete
authorLucas Mendes <lucas.mendes@wearespindle.com>
Fri, 19 Apr 2019 14:33:49 +0000 (16:33 +0200)
committerLucas Mendes <lucas.mendes@wearespindle.com>
Fri, 19 Apr 2019 14:33:49 +0000 (16:33 +0200)
We changed the validation of autocomplete parameter in the "indications
remove" command to avoid continue the execution of the command after
asking for autocomplete out of range parameters.

ASTERISK-28391
Reported by: lmendes86

Change-Id: I92b24131fd02f2e3c7fec966eea6f7a663310d40

main/indications.c

index f1937926081a08b190cb61f82d268cd7c56a2bad..622f98db228e156ffb9d9461ce3cc5eb3261b81f 100644 (file)
@@ -780,9 +780,11 @@ static char *handle_cli_indication_remove(struct ast_cli_entry *e, int cmd, stru
        case CLI_GENERATE:
                if (a->pos == 2) {
                        return complete_country(a);
-               } else if (a->pos == 3) {
+               }
+               if (a->pos == 3) {
                        return complete_indications(a);
                }
+               return NULL;
        }
 
        if (a->argc != 3 && a->argc != 4) {