[asterisk-commits] kmoore: branch 10 r345064 - in /branches/10: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 14 09:10:41 CST 2011


Author: kmoore
Date: Mon Nov 14 09:10:38 2011
New Revision: 345064

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=345064
Log:
Ensure that a null vmexten does not cause a segfault

When sip_send_mwi_to_peer was modified recently to avoid deadlocks, vmexten
was not expected to be null.  This change handles that situation to avoid
a segfault.
........

Merged revisions 345063 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/channels/chan_sip.c

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

Modified: branches/10/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/channels/chan_sip.c?view=diff&rev=345064&r1=345063&r2=345064
==============================================================================
--- branches/10/channels/chan_sip.c (original)
+++ branches/10/channels/chan_sip.c Mon Nov 14 09:10:38 2011
@@ -25952,11 +25952,13 @@
 	/* Called with peerl lock, but releases it */
 	struct sip_pvt *p;
 	int newmsgs = 0, oldmsgs = 0;
-	const char *vmexten;
+	const char *vmexten = NULL;
 
 	ao2_lock(peer);
 
-	vmexten = ast_strdupa(peer->vmexten);
+	if (peer->vmexten) {
+		vmexten = ast_strdupa(peer->vmexten);
+	}
 
 	if (ast_test_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY) && !peer->mwipvt) {
 		ao2_unlock(peer);




More information about the asterisk-commits mailing list