From aaee0fa6f581fb3f98fdfcef685743526f8126b5 Mon Sep 17 00:00:00 2001
From: Lucas Mendes <lucas.mendes@wearespindle.com>
Date: Fri, 19 Apr 2019 16:33:49 +0200
Subject: [PATCH] res_indications: Fix indications remove command autocomplete

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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/main/indications.c b/main/indications.c
index f193792608..622f98db22 100644
--- a/main/indications.c
+++ b/main/indications.c
@@ -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) {
-- 
GitLab