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

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


George Joseph has uploaded a new change for review.

  https://gerrit.asterisk.org/2311

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/11/2311/1

diff --git a/res/res_sorcery_memory_cache.c b/res/res_sorcery_memory_cache.c
index 0421d81..704372e 100644
--- a/res/res_sorcery_memory_cache.c
+++ b/res/res_sorcery_memory_cache.c
@@ -1832,7 +1832,7 @@
 		}
 	}
 
-	if (a->argc > 6) {
+	if (a->argc < 5 || a->argc > 6) {
 		return CLI_SHOWUSAGE;
 	}
 
@@ -1886,7 +1886,7 @@
 		}
 	}
 
-	if (a->argc > 6) {
+	if (a->argc < 5 || a->argc > 6) {
 		return CLI_SHOWUSAGE;
 	}
 
@@ -1945,7 +1945,7 @@
 		}
 	}
 
-	if (a->argc > 5) {
+	if (a->argc != 5) {
 		return CLI_SHOWUSAGE;
 	}
 

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

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



More information about the asterisk-code-review mailing list