[asterisk-bugs] [Asterisk 0015617]: [patch] crash in LOCAL() if Gosub stack is allocated but empty

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Aug 9 02:11:44 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15617 
====================================================================== 
Reported By:                rain
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   15617
Category:                   Applications/app_stack
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           Older 1.6.0 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-07-30 14:45 CDT
Last Modified:              2009-08-09 02:11 CDT
====================================================================== 
Summary:                    [patch] crash in LOCAL() if Gosub stack is allocated
but empty
Description: 
If the Gosub stack is allocated but empty (e.g. outside of a Gosub, but
after a previous call to Gosub on the current channel), local_read() will
crash because it blindly dereferences frame = AST_LIST_FIRST(oldlist),
which will be NULL.

The attached patch (against trunk) ensures that the stack is not empty in
local_read() and deallocates the datastore in return_exec() if the stack is
empty.  The latter might not be desirable, but each change is in a separate
hunk in the patch should you only want one of them.  The patch applies
cleanly against 1.6.x as well.
====================================================================== 

---------------------------------------------------------------------- 
 (0108817) svnbot (reporter) - 2009-08-09 02:11
 https://issues.asterisk.org/view.php?id=15617#c108817 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 211232

U   trunk/apps/app_stack.c

------------------------------------------------------------------------
r211232 | tilghman | 2009-08-09 02:11:43 -0500 (Sun, 09 Aug 2009) | 4
lines

Check for NULL frame, before dereferencing pointer.
(closes issue https://issues.asterisk.org/view.php?id=15617)
 Reported by: rain

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=211232 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-08-09 02:11 svnbot         Checkin                                      
2009-08-09 02:11 svnbot         Note Added: 0108817                          
======================================================================




More information about the asterisk-bugs mailing list