[asterisk-commits] russell: branch 1.8 r359056 - /branches/1.8/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 13 18:58:44 CDT 2012


Author: russell
Date: Tue Mar 13 18:58:40 2012
New Revision: 359056

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=359056
Log:
Don't use a buffer after it goes out of scope.

's' is set to 'workspace'.  Make sure 'workspace' doesn't go out of scope while
the reference to it via 's' is still used.

Modified:
    branches/1.8/main/pbx.c

Modified: branches/1.8/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/pbx.c?view=diff&rev=359056&r1=359055&r2=359056
==============================================================================
--- branches/1.8/main/pbx.c (original)
+++ branches/1.8/main/pbx.c Tue Mar 13 18:58:40 2012
@@ -3136,6 +3136,7 @@
 	int offset, length;
 	int i, need_substring;
 	struct varshead *places[2] = { headp, &globals };	/* list of places where we may look */
+	char workspace[20];
 
 	if (c) {
 		ast_channel_lock(c);
@@ -3211,7 +3212,6 @@
 		} else if (!strcmp(var, "SYSTEMNAME")) {
 			s = ast_config_AST_SYSTEM_NAME;
 		} else if (!strcmp(var, "ENTITYID")) {
-			char workspace[20];
 			ast_eid_to_str(workspace, sizeof(workspace), &ast_eid_default);
 			s = workspace;
 		}




More information about the asterisk-commits mailing list