mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-06 13:07:21 +00:00
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:
18
main/acl.c
18
main/acl.c
@@ -488,7 +488,12 @@ struct ast_ha *ast_append_ha(const char *sense, const char *stuff, struct ast_ha
|
||||
ret = ha;
|
||||
}
|
||||
|
||||
ast_debug(1, "%s/%s sense %d appended to acl for peer\n", ast_strdupa(ast_sockaddr_stringify(&ha->addr)), ast_strdupa(ast_sockaddr_stringify(&ha->netmask)), ha->sense);
|
||||
{
|
||||
const char *addr = ast_strdupa(ast_sockaddr_stringify(&ha->addr));
|
||||
const char *mask = ast_strdupa(ast_sockaddr_stringify(&ha->netmask));
|
||||
|
||||
ast_debug(1, "%s/%s sense %d appended to acl for peer\n", addr, mask, ha->sense);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -701,9 +706,14 @@ int ast_ouraddrfor(const struct ast_sockaddr *them, struct ast_sockaddr *us)
|
||||
return -1;
|
||||
}
|
||||
close(s);
|
||||
ast_debug(3, "For destination '%s', our source address is '%s'.\n",
|
||||
ast_strdupa(ast_sockaddr_stringify_addr(them)),
|
||||
ast_strdupa(ast_sockaddr_stringify_addr(us)));
|
||||
|
||||
{
|
||||
const char *them_addr = ast_strdupa(ast_sockaddr_stringify_addr(them));
|
||||
const char *us_addr = ast_strdupa(ast_sockaddr_stringify_addr(us));
|
||||
|
||||
ast_debug(3, "For destination '%s', our source address is '%s'.\n",
|
||||
them_addr, us_addr);
|
||||
}
|
||||
|
||||
ast_sockaddr_set_port(us, port);
|
||||
|
||||
|
Reference in New Issue
Block a user