aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-09 09:42:54 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-09 09:42:54 +0000
commitc6a8c87fbba54ed82e192b735e4f7cffa5cab036 (patch)
treeb4105f856737cd2e5a4aa7c92eb99bcb34fe7d08 /channel.c
parenta985c15efe6b830411599a30b834bc6a5a8430ee (diff)
Don't allow masquerading into oneself (bug #3040)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4726 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rwxr-xr-xchannel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/channel.c b/channel.c
index bc54a8bc5..01e9c28be 100755
--- a/channel.c
+++ b/channel.c
@@ -2208,6 +2208,10 @@ int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clo
{
struct ast_frame null = { AST_FRAME_NULL, };
int res = -1;
+ if (original == clone) {
+ ast_log(LOG_WARNING, "Can't masquerade channel '%s' into itself!\n", original->name);
+ return -1;
+ }
ast_mutex_lock(&original->lock);
while(ast_mutex_trylock(&clone->lock)) {
ast_mutex_unlock(&original->lock);