]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_pubsub: Prevent crash from AMI command on freed subscription. 96/2096/1
authorMark Michelson <mmichelson@digium.com>
Mon, 25 Jan 2016 22:51:25 +0000 (16:51 -0600)
committerMark Michelson <mmichelson@digium.com>
Tue, 26 Jan 2016 21:00:21 +0000 (15:00 -0600)
commit22eb1b48c03037a823a25d1f4ca86077a432c30a
tree1ace87e675a07ebab0c41022b06220aa20f4d36a
parent826ff1d7a320ca6759fd7f9cdc35d1c719bc4d5f
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
(cherry picked from commit b073244c511f9634de57ea401ab9dbebcf2390e8)
res/res_pjsip_pubsub.c