diff options
author | Kevin Harwell <kharwell@digium.com> | 2014-10-30 21:13:30 +0000 |
---|---|---|
committer | Kevin Harwell <kharwell@digium.com> | 2014-10-30 21:13:30 +0000 |
commit | c3b1d0df0d1c0cdf85d35241041714815cb6178a (patch) | |
tree | 931ad80485886ffcc9ede10ce311b784a9ce6dc9 /res/res_pjsip_exten_state.c | |
parent | fed9d0deb064469e07cac51d26d1c7e122aaddf2 (diff) |
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
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@426780 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_exten_state.c')
-rw-r--r-- | res/res_pjsip_exten_state.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_pjsip_exten_state.c b/res/res_pjsip_exten_state.c index 6b8ee6c12..332f45b3a 100644 --- a/res/res_pjsip_exten_state.c +++ b/res/res_pjsip_exten_state.c @@ -457,6 +457,10 @@ static void to_ami(struct ast_sip_subscription *sub, 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( |