diff options
author | Mark Spencer <markster@digium.com> | 2005-01-09 09:42:54 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2005-01-09 09:42:54 +0000 |
commit | 88979c2a4a705dd1254504c0e049a8f6617e17bf (patch) | |
tree | b4105f856737cd2e5a4aa7c92eb99bcb34fe7d08 /channel.c | |
parent | 7af0234fa7b0aff6e7130ad0a13f85fae8fe0a77 (diff) |
Don't allow masquerading into oneself (bug #3040)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channel.c')
-rwxr-xr-x | channel.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |