[Asterisk-code-review] res sorcery memory cache: Fix SEGV in some CLI commands (asterisk[13])

George Joseph asteriskteam at digium.com
Thu Feb 25 14:18:35 CST 2016


George Joseph has uploaded a new change for review.

  https://gerrit.asterisk.org/2310

Change subject: res_sorcery_memory_cache:  Fix SEGV in some CLI commands
......................................................................

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
---
M res/res_sorcery_memory_cache.c
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/10/2310/1

diff --git a/res/res_sorcery_memory_cache.c b/res/res_sorcery_memory_cache.c
index 99db0ce..f2ed5d5 100644
--- a/res/res_sorcery_memory_cache.c
+++ b/res/res_sorcery_memory_cache.c
@@ -1830,7 +1830,7 @@
 		}
 	}
 
-	if (a->argc > 6) {
+	if (a->argc < 5 || a->argc > 6) {
 		return CLI_SHOWUSAGE;
 	}
 
@@ -1884,7 +1884,7 @@
 		}
 	}
 
-	if (a->argc > 6) {
+	if (a->argc < 5 || a->argc > 6) {
 		return CLI_SHOWUSAGE;
 	}
 
@@ -1943,7 +1943,7 @@
 		}
 	}
 
-	if (a->argc > 5) {
+	if (a->argc != 5) {
 		return CLI_SHOWUSAGE;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/2310
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6494132ad2fe54b4f014bcdc112a37c36a9b413
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>



More information about the asterisk-code-review mailing list