diff options
author | David Vossel <dvossel@digium.com> | 2010-05-19 19:21:04 +0000 |
---|---|---|
committer | David Vossel <dvossel@digium.com> | 2010-05-19 19:21:04 +0000 |
commit | 0407208b6d6ab14a14e253ec8dc062e493bdb331 (patch) | |
tree | 30593f62555b032c515c14a556721f14304ebdf4 /channels/chan_sip.c | |
parent | b5a629624ae4c0715a92d64a32d2a721db0d197e (diff) |
fixes crash in check_rtp_timeout
During deadlock avoidance the sip dialog pvt is locked and
unlocked. When this occurs we have no guarantee the pvt's owner
is still valid. We were trying to access the pvt's owner after
this without checking to see if it still existed first.
(closes issue #17271)
Reported by: under
Patches:
check_rtp_timeout.diff uploaded by under (license 914)
Tested by: dvossel
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 9bb79167a..689ed477b 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -23461,6 +23461,9 @@ static void check_rtp_timeout(struct sip_pvt *dialog, time_t t) usleep(1); sip_pvt_lock(dialog); } + if (!dialog->owner) { + return; /* channel hangup can occur during deadlock avoidance. */ + } ast_log(LOG_NOTICE, "Disconnecting call '%s' for lack of RTP activity in %ld seconds\n", dialog->owner->name, (long) (t - dialog->lastrtprx)); /* Issue a softhangup */ |