]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_pubsub: Prevent crash from AMI command on freed subscription. 89/2089/1
authorMark Michelson <mmichelson@digium.com>
Mon, 25 Jan 2016 22:51:25 +0000 (16:51 -0600)
committerMark Michelson <mmichelson@digium.com>
Mon, 25 Jan 2016 22:51:25 +0000 (16:51 -0600)
commit8261bda1bf63d76f0913a5273c9b7ae1729addec
tree3856117c237d1840694bfe2db9e56033fc4cffba
parenta6823bb0c4f33dd19c11cd30f23650a194c2dbb7
res_pjsip_pubsub: Prevent crash from AMI command on freed subscription.

A test recently uncovered that running an ill-timed AMI command to show
inbound subscriptions could cause a crash since Asterisk will try to
operate on a freed subscription.

The fix for this is to remove the subscription tree from the list of
subscriptions at the time that we are sending our final NOTIFY request
out. This way, as the subscription is in the process of dying, it is
inaccessible from AMI.

Change-Id: Ic0239003d8d73e04c47c12dd2a7e23867e5b5b23
res/res_pjsip_pubsub.c