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

Joshua Colp asteriskteam at digium.com
Sat Feb 27 08:50:20 CST 2016


Joshua Colp has submitted this change and it was merged.

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(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



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: merged
Gerrit-Change-Id: Ie6494132ad2fe54b4f014bcdc112a37c36a9b413
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list