[asterisk-commits] mmichelson: branch 1.6.2 r201461 - in /branches/1.6.2: ./ main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 17 15:06:14 CDT 2009


Author: mmichelson
Date: Wed Jun 17 15:06:11 2009
New Revision: 201461

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=201461
Log:
Merged revisions 201458 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r201458 | mmichelson | 2009-06-17 15:04:12 -0500 (Wed, 17 Jun 2009) | 15 lines
  
  Merged revisions 201450 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r201450 | mmichelson | 2009-06-17 14:59:31 -0500 (Wed, 17 Jun 2009) | 9 lines
    
    Change the datastore traversal in ast_do_masquerade to use a safe list traversal.
    
    It is possible for datastore fixup functions to remove the datastore from the list
    and free it. In particular, the queue_transfer_fixup in app_queue does this. While
    I don't yet know of this causing any crashes, it certainly could.
    
    Found while discussing a separate issue with Brian Degenhardt.
  ........
................

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/main/channel.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/main/channel.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/main/channel.c?view=diff&rev=201461&r1=201460&r2=201461
==============================================================================
--- branches/1.6.2/main/channel.c (original)
+++ branches/1.6.2/main/channel.c Wed Jun 17 15:06:11 2009
@@ -4425,10 +4425,14 @@
 	/* Move data stores over */
 	if (AST_LIST_FIRST(&clonechan->datastores)) {
 		struct ast_datastore *ds;
-		AST_LIST_TRAVERSE(&clonechan->datastores, ds, entry) {
+		/* We use a safe traversal here because some fixup routines actually
+		 * remove the datastore from the list and free them.
+		 */
+		AST_LIST_TRAVERSE_SAFE_BEGIN(&clonechan->datastores, ds, entry) {
 			if (ds->info->chan_fixup)
 				ds->info->chan_fixup(ds->data, clonechan, original);
 		}
+		AST_LIST_TRAVERSE_SAFE_END;
 		AST_LIST_APPEND_LIST(&original->datastores, &clonechan->datastores, entry);
 	}
 




More information about the asterisk-commits mailing list