diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-21 15:43:33 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-21 15:43:33 +0000 |
commit | e6eea3082a1ab405b38b43c49a949d0d83f08995 (patch) | |
tree | ac0cbc154e80446273680ee74c0541836c130f7c /res/res_rtp_asterisk.c | |
parent | 9f00173720ddbd28cf3e628bdc97826e573ff522 (diff) |
Don't use ast_strdupa() from within the arguments to a function.
(closes issue #17902)
Reported by: afried
Patches:
issue_17902.rev1.txt uploaded by russell (license 2)
Tested by: russell
Review: https://reviewboard.asterisk.org/r/927/
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@287895 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r-- | res/res_rtp_asterisk.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 6ddd33902..643794890 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -2012,9 +2012,12 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc ast_sockaddr_copy(&rtp->strict_rtp_address, &addr); } else { + const char *real_addr = ast_strdupa(ast_sockaddr_stringify(&addr)); + const char *expected_addr = ast_strdupa(ast_sockaddr_stringify(&rtp->strict_rtp_address)); + ast_debug(1, "Received RTP packet from %s, dropping due to strict RTP protection. Expected it to be from %s\n", - ast_strdupa(ast_sockaddr_stringify(&addr)), - ast_strdupa(ast_sockaddr_stringify(&rtp->strict_rtp_address))); + real_addr, expected_addr); + return &ast_null_frame; } } |