aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-28 18:34:20 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-28 18:34:20 +0000
commitbd6c7265c5c40fb35e9175ca113526bf2d6c369e (patch)
tree84b6434ad2d6a4b68bd01c7249810a678f881823 /channels
parentfdeaaeb55e6d9e6a6f4e547e928bd011fe8a97c6 (diff)
For some reason, the use of this strdupa() is leading to memory corruption on
freebsd sparc64. This trivial workaround fixes it. (closes issue #10300, closes issue #11857, reported by mattias04 and Home-of-the-Brave) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@100629 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5c33ce7dc..e52095bc7 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -7936,9 +7936,9 @@ static int set_address_from_contact(struct sip_pvt *pvt)
struct ast_hostent ahp;
int port;
char *c, *host, *pt;
+ char contact_buf[256];
char *contact;
-
if (ast_test_flag(&pvt->flags[0], SIP_NAT_ROUTE)) {
/* NAT: Don't trust the contact field. Just use what they came to us
with. */
@@ -7946,9 +7946,9 @@ static int set_address_from_contact(struct sip_pvt *pvt)
return 0;
}
-
/* Work on a copy */
- contact = ast_strdupa(pvt->fullcontact);
+ ast_copy_string(contact_buf, pvt->fullcontact, sizeof(contact_buf));
+ contact = contact_buf;
/* Make sure it's a SIP URL */
if (strncasecmp(contact, "sip:", 4)) {