From: George Joseph Date: Thu, 25 Feb 2016 20:17:04 +0000 (-0700) Subject: res_sorcery_memory_cache: Fix SEGV in some CLI commands X-Git-Tag: 14.0.0-beta1~380^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e3e1ddf7ef1b0016edaebab711b874d489b9e9c;p=thirdparty%2Fasterisk.git res_sorcery_memory_cache: Fix SEGV in some CLI commands A few of the CLI commands weren't checking for enough arguments and were SEGVing. Change-Id: Ie6494132ad2fe54b4f014bcdc112a37c36a9b413 --- diff --git a/res/res_sorcery_memory_cache.c b/res/res_sorcery_memory_cache.c index 0421d81583..704372e12b 100644 --- a/res/res_sorcery_memory_cache.c +++ b/res/res_sorcery_memory_cache.c @@ -1832,7 +1832,7 @@ static char *sorcery_memory_cache_expire(struct ast_cli_entry *e, int cmd, struc } } - if (a->argc > 6) { + if (a->argc < 5 || a->argc > 6) { return CLI_SHOWUSAGE; } @@ -1886,7 +1886,7 @@ static char *sorcery_memory_cache_stale(struct ast_cli_entry *e, int cmd, struct } } - if (a->argc > 6) { + if (a->argc < 5 || a->argc > 6) { return CLI_SHOWUSAGE; } @@ -1945,7 +1945,7 @@ static char *sorcery_memory_cache_populate(struct ast_cli_entry *e, int cmd, str } } - if (a->argc > 5) { + if (a->argc != 5) { return CLI_SHOWUSAGE; }