[svn-commits] kmoore: trunk r345065 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Nov 14 09:11:13 CST 2011


Author: kmoore
Date: Mon Nov 14 09:11:09 2011
New Revision: 345065

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=345065
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
........

Merged revisions 345064 from http://svn.asterisk.org/svn/asterisk/branches/10

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

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

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=345065&r1=345064&r2=345065
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Nov 14 09:11:09 2011
@@ -26001,11 +26001,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 svn-commits mailing list