[asterisk-commits] kharwell: branch 12 r426779 - /branches/12/res/res_pjsip_exten_state.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 30 16:12:31 CDT 2014


Author: kharwell
Date: Thu Oct 30 16:12:25 2014
New Revision: 426779

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=426779
Log:
res_pjsip_exten_state: PJSIPShowSubscriptionsInbound causes crash

Currently, it is possible for some subscriptions to get into a NULL state. When
this occurs and the PJSIPShowSubscriptionsInbound ami action is issued and a
device is subscribed for extension state then the associated subscription state
object can't be located.  The code then attempts to dereference a NULL object.
Added a NULL check to avoid the problem.

Reported by: John Bigelow

Modified:
    branches/12/res/res_pjsip_exten_state.c

Modified: branches/12/res/res_pjsip_exten_state.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_exten_state.c?view=diff&rev=426779&r1=426778&r2=426779
==============================================================================
--- branches/12/res/res_pjsip_exten_state.c (original)
+++ branches/12/res/res_pjsip_exten_state.c Thu Oct 30 16:12:25 2014
@@ -520,6 +520,10 @@
 	struct exten_state_subscription *exten_state_sub =
 		get_exten_state_sub(sub);
 
+	if (!exten_state_sub) {
+		return;
+	}
+
 	ast_str_append(buf, 0, "SubscriptionType: extension_state\r\n"
 		       "Extension: %s\r\nExtensionStates: %s\r\n",
 		       exten_state_sub->exten, ast_extension_state2str(




More information about the asterisk-commits mailing list