[svn-commits] russell: trunk r69945 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 19 10:27:16 CDT 2007


Author: russell
Date: Tue Jun 19 10:27:16 2007
New Revision: 69945

URL: http://svn.digium.com/view/asterisk?view=rev&rev=69945
Log:
Merged revisions 69944 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r69944 | russell | 2007-06-19 10:22:36 -0500 (Tue, 19 Jun 2007) | 10 lines

Fix a crash that could occur when handing device state changes.
When the state of a device changes, the device state thread tells the extension
state handling code that it changed.  Then, the extension state code calls the
callback in chan_sip so that it can update subscriptions to that extension.
A pointer to a sip_pvt structure is passed to this function as the call which
needs a NOTIFY sent.  However, there was no locking done to ensure that the pvt
struct didn't disappear during this process.
(issue #9946, reported by tdonahue, patch by me, patch updated to trunk to use
 the sip_pvt lock wrappers by eliel)

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

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

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=69945&r1=69944&r2=69945
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Jun 19 10:27:16 2007
@@ -8824,6 +8824,8 @@
 {
 	struct sip_pvt *p = data;
 
+	sip_pvt_lock(p);
+
 	switch(state) {
 	case AST_EXTENSION_DEACTIVATED:	/* Retry after a while */
 	case AST_EXTENSION_REMOVED:	/* Extension is gone */
@@ -8844,6 +8846,9 @@
 
 	if (option_verbose > 1)
 		ast_verbose(VERBOSE_PREFIX_1 "Extension Changed %s new state %s for Notify User %s\n", exten, ast_extension_state2str(state), p->username);
+
+	sip_pvt_unlock(p);
+
 	return 0;
 }
 




More information about the svn-commits mailing list