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: https://origsvn.digium.com/svn/asterisk/branches/1.8@287895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2010-09-21 15:43:33 +00:00
parent a39b2f5ed2
commit d0581b8bbd
4 changed files with 50 additions and 26 deletions

View File

@@ -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;
}
}