[asterisk-commits] mnicholson: branch 1.4 r287307 - /branches/1.4/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 17 08:34:46 CDT 2010


Author: mnicholson
Date: Fri Sep 17 08:34:34 2010
New Revision: 287307

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=287307
Log:
Use ast_strdup() instead of ast_strdupa() while processing in ast_hint_state_changed().

(related to issue #17928)
Reported by: mdu113

Modified:
    branches/1.4/main/pbx.c

Modified: branches/1.4/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/main/pbx.c?view=diff&rev=287307&r1=287306&r2=287307
==============================================================================
--- branches/1.4/main/pbx.c (original)
+++ branches/1.4/main/pbx.c Fri Sep 17 08:34:34 2010
@@ -2017,14 +2017,19 @@
 
 	AST_LIST_TRAVERSE(&hints, hint, list) {
 		struct ast_state_cb *cblist;
-		char *parse = ast_strdupa(ast_get_extension_app(hint->exten));
-		char *cur;
+		/* can't use ast_strdupa() here because we may run out of stack
+		 * space while looping over a large number of large strings */
+		char *dup = ast_strdup(ast_get_extension_app(hint->exten));
+		char *cur, *parse = dup;
 		int state;
 
 		while ( (cur = strsep(&parse, "&")) ) {
 			if (!strcasecmp(cur, device))
 				break;
 		}
+
+		ast_free(dup);
+
 		if (!cur)
 			continue;
 




More information about the asterisk-commits mailing list