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(


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to