[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:12:29 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:                     closed
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:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-07-30 14:45 CDT
Last Modified:              2009-08-09 02:12 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.
====================================================================== 

---------------------------------------------------------------------- 
 (0108818) svnbot (reporter) - 2009-08-09 02:12
 https://issues.asterisk.org/view.php?id=15617#c108818 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 211233

_U  branches/1.6.0/
U   branches/1.6.0/apps/app_stack.c

------------------------------------------------------------------------
r211233 | tilghman | 2009-08-09 02:12:29 -0500 (Sun, 09 Aug 2009) | 11
lines

Merged revisions 211232 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r211232 | tilghman | 2009-08-09 02:11:22 -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=211233 

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




More information about the asterisk-bugs mailing list