[asterisk-commits] coreyfarrell: branch 1.8 r407100 - /branches/1.8/apps/app_stack.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 31 18:22:53 CST 2014


Author: coreyfarrell
Date: Fri Jan 31 18:22:52 2014
New Revision: 407100

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=407100
Log:
app_stack: protect against missing parameters to STACK_PEEK and LOCAL_PEEK

STACK_PEEK requires 2 parameters and LOCAL_PEEK requires 1 parameter.  This
protects against situations where those parameters are blank or missing by
logging an error and returning.

(closes issue ASTERISK-23220)
Reported by: James Sharp

Modified:
    branches/1.8/apps/app_stack.c

Modified: branches/1.8/apps/app_stack.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/apps/app_stack.c?view=diff&rev=407100&r1=407099&r2=407100
==============================================================================
--- branches/1.8/apps/app_stack.c (original)
+++ branches/1.8/apps/app_stack.c Fri Jan 31 18:22:52 2014
@@ -645,6 +645,12 @@
 	}
 
 	AST_STANDARD_RAW_ARGS(args, data);
+
+	if (ast_strlen_zero(args.n) || ast_strlen_zero(args.name)) {
+		ast_log(LOG_ERROR, "LOCAL_PEEK requires parameters n and varname\n");
+		return -1;
+	}
+
 	n = atoi(args.n);
 	*buf = '\0';
 
@@ -683,6 +689,11 @@
 
 	data = ast_strdupa(data);
 	AST_STANDARD_APP_ARGS(args, data);
+
+	if (ast_strlen_zero(args.n) || ast_strlen_zero(args.which)) {
+		ast_log(LOG_ERROR, "STACK_PEEK requires parameters n and which\n");
+		return -1;
+	}
 
 	n = atoi(args.n);
 	if (n <= 0) {




More information about the asterisk-commits mailing list