[svn-commits] russell: branch 1.4 r275994 - /branches/1.4/res/res_features.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jul 13 11:51:22 CDT 2010


Author: russell
Date: Tue Jul 13 11:51:18 2010
New Revision: 275994

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=275994
Log:
Access peer->cdr directly instead of through a saved off reference.

At this point in the code, it is possible that peer_cdr may be invalid.
Specifically, in the blind transfer code, CDRs are swapped between channels.
So, peer_cdr is no longer == peer->cdr.

The scenario that exposed a crash in this code was a blind transfer that hit
the system call limit, causing the transferee channel to get destroyed after
the transfer attempt failed.  Even if it succeeds and this code doesn't crash,
this code was still trying to reset a CDR on a channel that was now owned by
a different thread, which is a BadThing(tm).

(ABE-2417)

Modified:
    branches/1.4/res/res_features.c

Modified: branches/1.4/res/res_features.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/res/res_features.c?view=diff&rev=275994&r1=275993&r2=275994
==============================================================================
--- branches/1.4/res/res_features.c (original)
+++ branches/1.4/res/res_features.c Tue Jul 13 11:51:18 2010
@@ -2195,7 +2195,7 @@
 			/* new channel */
 			ast_cdr_specialized_reset(new_peer_cdr,0);
 		} else {
-			ast_cdr_specialized_reset(peer_cdr,0); /* nothing changed, reset the peer_cdr  */
+			ast_cdr_specialized_reset(peer->cdr, 0); /* nothing changed, reset the peer cdr  */
 		}
 	}
 	




More information about the svn-commits mailing list