res_pjsip_pubsub: segfault in function publish_expire
authorAlexei Gradinari <alex2grad@gmail.com>
Thu, 5 Jul 2018 21:02:00 +0000 (17:02 -0400)
committerAlexei Gradinari <alex2grad@gmail.com>
Fri, 6 Jul 2018 20:08:42 +0000 (15:08 -0500)
commit96abe79ddf70900c74a3859dcbe9c2a9c04e5619
tree63045d379eeda50464edf7dbcea23e385fd39fc8
parentee3cbce5ba522db44973f0bfe8822e93a7e8161e
res_pjsip_pubsub: segfault in function publish_expire

The function pubsub_on_rx_publish_request incorrectly uses
of AST_SCHED_REPLACE_UNREF.

The AST_SCHED_REPLACE_UNREF should unref old '_data'.

Because of this, there may be a double unref
of variable 'publication' when ast_sched_del is unsuccessful
that leads to use after free of the 'publication' in publish_expire.

ASTERISK-27956 #close

Change-Id: Ie0f0cfc7e036953d890b188656010b325a5cdc82
res/res_pjsip_pubsub.c