[asterisk-bugs] [Asterisk 0013715]: [patch] Using SIP_HEADER in AMI with NULL channel causes crash

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Oct 16 17:56:47 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13715 
====================================================================== 
Reported By:                makoto
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13715
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.2.X 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-10-16 03:58 CDT
Last Modified:              2008-10-16 17:56 CDT
====================================================================== 
Summary:                    [patch] Using SIP_HEADER in AMI with NULL channel
causes crash
Description: 
Connect to AMI, then send the following lines.
So asterisk will crash.

Action: GetVar
Channel: 
Variable: SIP_HEADER(P-Called-Party-ID)

I have tested only on 1.2, but I believe that it happens on 1.4 or later.

Attached patch will fix the problem.

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

---------------------------------------------------------------------- 
 (0093862) putnopvut (administrator) - 2008-10-16 17:56
 http://bugs.digium.com/view.php?id=13715#c93862 
---------------------------------------------------------------------- 
Actually, seeing this in further detail, I realized that this is actually
an easy thing to set up myself. I gave the test a shot, and sure enough, it
crashed in 1.4, too!

So, on to your patch. It appears that this crash will happen with any
dialplan function which does not check for a channel to be non-NULL.
Instead of modifying chan_sip to not crash in func_header_read, it would be
a much better idea to nip the problem in the bud, so to speak, by making
sure not to call any dialplan functions at all if the channel is NULL. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-10-16 17:56 putnopvut      Note Added: 0093862                          
======================================================================




More information about the asterisk-bugs mailing list