diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-24 13:50:30 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-09-24 13:50:30 +0000 |
commit | e4f39c4275ed56a1a22fcb7bcb68cb9645700807 (patch) | |
tree | b62b20cbf259a2062110337719263c7c47391bb5 /channels/chan_iax2.c | |
parent | 07f3035c210e1052adff25286e16ff28679f3fa1 (diff) |
Check to see if the channel that is activating the IAXPEER function is actually
an IAX2 channel before proceeding to process it to avoid crashing.
(issue #8017, reported by admott, fixed by myself)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@43552 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 3f576c4de..701e21e35 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -9342,6 +9342,11 @@ static char *function_iaxpeer(struct ast_channel *chan, char *cmd, char *data, c char *peername, *colname; char iabuf[INET_ADDRSTRLEN]; + buf[0] = '\0'; + + if (chan->tech != &iax2_tech) + return buf; + if (!(peername = ast_strdupa(data))) { ast_log(LOG_ERROR, "Memory Error!\n"); return ret; |