[asterisk-commits] tilghman: trunk r211232 - /trunk/apps/app_stack.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Aug 9 02:11:27 CDT 2009


Author: tilghman
Date: Sun Aug  9 02:11:22 2009
New Revision: 211232

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=211232
Log:
Check for NULL frame, before dereferencing pointer.
(closes issue #15617)
 Reported by: rain

Modified:
    trunk/apps/app_stack.c

Modified: trunk/apps/app_stack.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_stack.c?view=diff&rev=211232&r1=211231&r2=211232
==============================================================================
--- trunk/apps/app_stack.c (original)
+++ trunk/apps/app_stack.c Sun Aug  9 02:11:22 2009
@@ -474,7 +474,12 @@
 
 	oldlist = stack_store->data;
 	AST_LIST_LOCK(oldlist);
-	frame = AST_LIST_FIRST(oldlist);
+	if (!(frame = AST_LIST_FIRST(oldlist))) {
+		/* Not within a Gosub routine */
+		AST_LIST_UNLOCK(oldlist);
+		return -1;
+	}
+
 	AST_LIST_TRAVERSE(&frame->varshead, variables, entries) {
 		if (!strcmp(data, ast_var_name(variables))) {
 			const char *tmp;




More information about the asterisk-commits mailing list