]> git.ipfire.org Git - thirdparty/asterisk.git/commit
channels/chan_sip: Fix crash when transmitting packet after thread shutdown
authorMatthew Jordan <mjordan@digium.com>
Tue, 24 Feb 2015 22:14:02 +0000 (22:14 +0000)
committerMatthew Jordan <mjordan@digium.com>
Tue, 24 Feb 2015 22:14:02 +0000 (22:14 +0000)
commit789d4379b6566314a7b9b56b7a4811d7fa9507ce
treee37b8dba4e7663668e3a951e02dc2d9f7bcaa584
parent5c89e951bcb7d4bf49b0734980f523c458a254ec
channels/chan_sip: Fix crash when transmitting packet after thread shutdown

When the monitor thread is stopped, its pthread ID is set to a specific value
(AST_PTHREADT_STOP) so that later portions of the code can determine whether
or not it is safe to manipulate the thread. Unfortunately, __sip_reliable_xmit
failed to check for that value, checking instead only for AST_PTHREAD_STOP.
Passing the invalid yet very specific value to pthread_kill causes a crash.

This patch adds a check for AST_PTHREADT_STOP in __sip_reliable_xmit such that
it doesn't attempt to poke the thread if the thread has already been stopped.

ASTERISK-24800 #close
Reported by: JoshE

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@432198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_sip.c