mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 18:40:46 +00:00
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 ........ Merged revisions 426779 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 426780 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -457,6 +457,10 @@ static void to_ami(struct ast_sip_subscription *sub,
|
|||||||
struct exten_state_subscription *exten_state_sub =
|
struct exten_state_subscription *exten_state_sub =
|
||||||
get_exten_state_sub(sub);
|
get_exten_state_sub(sub);
|
||||||
|
|
||||||
|
if (!exten_state_sub) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ast_str_append(buf, 0, "SubscriptionType: extension_state\r\n"
|
ast_str_append(buf, 0, "SubscriptionType: extension_state\r\n"
|
||||||
"Extension: %s\r\nExtensionStates: %s\r\n",
|
"Extension: %s\r\nExtensionStates: %s\r\n",
|
||||||
exten_state_sub->exten, ast_extension_state2str(
|
exten_state_sub->exten, ast_extension_state2str(
|
||||||
|
Reference in New Issue
Block a user