[asterisk-bugs] [Asterisk 0010300]: memory corruption on freebsd sparc64

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Aug 9 18:15:16 CDT 2007


The following issue has been CLOSED 
====================================================================== 
http://bugs.digium.com/view.php?id=10300 
====================================================================== 
Reported By:                mattias04
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   10300
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Asterisk Version:           1.4.9  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             07-25-2007 09:40 CDT
Last Modified:              08-09-2007 18:15 CDT
====================================================================== 
Summary:                    memory corruption on freebsd sparc64
Description: 
after calling strchr in function set_address_from_contact()
...
 /* Grab host */
host = strchr(contact, '@');
...
memory gets corrupted.
strchr should not alter input string.

I suspect that
...
/* Work on a copy */
contact = ast_strdupa(pvt->fullcontact);
...
might have something to do with it.
When doing  some debugging I get this:

njord*CLI>
[Jul 25 14:11:43] WARNING[22832]: chan_sip.c:7779
set_address_from_contact: MWE DEBUG: pvt->fullcontact :
'sip:020252500 at 83.140.41.50'
[Jul 25 14:11:43] WARNING[22832]: chan_sip.c:7781
set_address_from_contact: MWE DEBUG: contact :
'sip:020252500 at 83.140.41.50'
[Jul 25 14:11:43] WARNING[22832]: chan_sip.c:7793
set_address_from_contact: MWE DEBUG: contact : '020252500 at 83.140.41.50'
[Jul 25 14:11:43] WARNING[22832]: chan_sip.c:7795
set_address_from_contact: MWE DEBUG: strchr contact :
'020252500 at 83.140.41.'
[Jul 25 14:11:43] WARNING[22832]: chan_sip.c:7796
set_address_from_contact: MWE DEBUG: strchr host : '@83.140.41.'
[Jul 25 14:11:43] WARNING[22832]: chan_sip.c:7810
set_address_from_contact: MWE DEBUG: contact : '020252500'
[Jul 25 14:11:43] WARNING[22832]: chan_sip.c:7812
set_address_from_contact: MWE DEBUG: contact strsep : '020252500'
[Jul 25 14:11:43] WARNING[22832]: chan_sip.c:7813
set_address_from_contact: MWE DEBUG: host : '83.140.41.'
[Jul 25 14:11:43] WARNING[22832]: chan_sip.c:7815
set_address_from_contact: MWE DEBUG: host strsep : '83.140.41.'
[Jul 25 14:11:43] WARNING[22832]: chan_sip.c:7821
set_address_from_contact: Invalid host name in Contact: (can't resolve in
DNS) : '83.140.41.'
[Jul 25 14:11:50] WARNING[22832]: chan_sip.c:12459 handle_response: Remote
host can't match request BYE to call
'2014421459e28760110e8f3a50dae531 at cx-cust-shg


As you can see the IP address 83.140.41.50 get truncated.

====================================================================== 

---------------------------------------------------------------------- 
 putnopvut - 08-09-07 18:15  
---------------------------------------------------------------------- 
I sent an e-mail to the asterisk users list a week ago regarding this issue
and received no responses. I've not heard of any other users who have had
this issue, and there appears to be nothing wrong with the code.

I'm closing this issue since I believe the problem to be dependent on your
system. If someone finds a way to reliably reproduce this issue on similar
systems, then please reopen. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-09-07 18:15  putnopvut      Status                   new => closed       
08-09-07 18:15  putnopvut      Note Added: 0068691                          
======================================================================




More information about the asterisk-bugs mailing list