summaryrefslogtreecommitdiff
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2012-03-16 21:00:07 +0000
committerJonathan Rose <jrose@digium.com>2012-03-16 21:00:07 +0000
commit0399daaa2e789a187ebb4a25720814c32fed2fc2 (patch)
tree62ce6312c9dc384aedd820ad6f261a42d47e04a5 /apps/app_chanspy.c
parentdd4a3b182565a709bbf77fee337622edcd88ff55 (diff)
Prevent chanspy from binding to zombie channels
This patch addresses a bug with chanspy on local channels which roughly 50% of the time would create a situation where chanspy can latch onto a zombie channel, keeping the zombie alive forever and causing the channel doing the spying to never be able to hang up. (closes issue ASTERISK-19493) Reported by: lvl Review: https://reviewboard.asterisk.org/r/1819/ ........ Merged revisions 359892 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 359898 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r--apps/app_chanspy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index cafc62b39..9a39622b5 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -529,7 +529,8 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto
/* We now hold the channel lock on spyee */
- if (ast_check_hangup(chan) || ast_check_hangup(spyee_autochan->chan)) {
+ if (ast_check_hangup(chan) || ast_check_hangup(spyee_autochan->chan) ||
+ ast_test_flag(ast_channel_flags(spyee_autochan->chan), AST_FLAG_ZOMBIE)) {
return 0;
}