[asterisk-commits] mnicholson: trunk r287310 - in /trunk: ./ main/pbx.c

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


Author: mnicholson
Date: Fri Sep 17 08:38:22 2010
New Revision: 287310

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=287310
Log:
Merged revisions 287309 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r287309 | mnicholson | 2010-09-17 08:37:10 -0500 (Fri, 17 Sep 2010) | 19 lines
  
  Merged revisions 287308 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r287308 | mnicholson | 2010-09-17 08:36:07 -0500 (Fri, 17 Sep 2010) | 12 lines
    
    Merged revisions 287307 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r287307 | mnicholson | 2010-09-17 08:34:34 -0500 (Fri, 17 Sep 2010) | 5 lines
      
      Use ast_strdup() instead of ast_strdupa() while processing in ast_hint_state_changed().
      
      (related to issue #17928)
      Reported by: mdu113
    ........
  ................
................

Modified:
    trunk/   (props changed)
    trunk/main/pbx.c

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

Modified: trunk/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/pbx.c?view=diff&rev=287310&r1=287309&r2=287310
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Fri Sep 17 08:38:22 2010
@@ -4225,8 +4225,10 @@
 
 	AST_RWLIST_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, "&")) ) {
@@ -4234,6 +4236,9 @@
 				break;
 			}
 		}
+
+		ast_free(dup);
+
 		if (!cur) {
 			continue;
 		}




More information about the asterisk-commits mailing list