[asterisk-commits] coreyfarrell: branch 11 r407103 - in /branches/11: ./ apps/app_stack.c

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


Author: coreyfarrell
Date: Fri Jan 31 18:23:42 2014
New Revision: 407103

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=407103
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
........

Merged revisions 407100 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/11/   (props changed)
    branches/11/apps/app_stack.c

Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/11/apps/app_stack.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/apps/app_stack.c?view=diff&rev=407103&r1=407102&r2=407103
==============================================================================
--- branches/11/apps/app_stack.c (original)
+++ branches/11/apps/app_stack.c Fri Jan 31 18:23:42 2014
@@ -763,6 +763,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';
 
@@ -801,6 +807,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