Merge "res_sorcery_memory_cache: Fix SEGV in some CLI commands"
authorJoshua Colp <jcolp@digium.com>
Sat, 27 Feb 2016 14:50:20 +0000 (08:50 -0600)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Sat, 27 Feb 2016 14:50:20 +0000 (08:50 -0600)
res/res_sorcery_memory_cache.c

index 0421d81..704372e 100644 (file)
@@ -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;
        }