[asterisk-bugs] [Asterisk 0017970]: [patch] res_agi.c:handle_getvariablefull() failes to unlock channel if given channel name of the channel that AGI is running on

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Sep 30 12:09:49 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17970 
====================================================================== 
Reported By:                mdu113
Assigned To:                bbryant
====================================================================== 
Project:                    Asterisk
Issue ID:                   17970
Category:                   Resources/res_agi
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Target Version:             1.4.38
Asterisk Version:           SVN 
JIRA:                       SWP-2189 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 285365 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2010-09-08 12:26 CDT
Last Modified:              2010-09-30 12:09 CDT
====================================================================== 
Summary:                    [patch] res_agi.c:handle_getvariablefull() failes to
unlock channel if given channel name of the channel that AGI is running on
Description: 
AGI command GET FULL VARIABLE supports operating on a channel given as a
channel name and it is perfectly OK to supply channel name of the channel
it's running on, i.e. perl example would be:


my $channel=$agi->get_variable("CHANNEL");
my $res=$agi->get_full_variable("somevar",$channel)

In this case handle_getvariablefull() fails to unlock channel resulting in
deadlocked asterisk. It fails to unlock it because condition at line 1254
of res_agi.c in this case evaluates to false (chan2 is actually == chan)
I've attached a simple patch to fix it
====================================================================== 

---------------------------------------------------------------------- 
 (0127545) svnbot (reporter) - 2010-09-30 12:09
 https://issues.asterisk.org/view.php?id=17970#c127545 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 289501

_U  branches/1.6.2/
U   branches/1.6.2/res/res_agi.c

------------------------------------------------------------------------
r289501 | bbryant | 2010-09-30 12:09:49 -0500 (Thu, 30 Sep 2010) | 18
lines

Merged revisions 289500 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r289500 | bbryant | 2010-09-30 13:08:20 -0400 (Thu, 30 Sep 2010) | 11
lines
  
  res_agi.c:handle_getvariablefull() could recursively lock a channel and
not
  release it if an argument is the current channel's name.
  
  (closes issue https://issues.asterisk.org/view.php?id=17970)
  Reported by: mdu113
  Patches: 
        res_agi.c.diff3 uploaded by mdu113 (license 582)
        Tested by: mdu113
  
        Review: https://reviewboard.asterisk.org/r/947/
........

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-09-30 12:09 svnbot         Checkin                                      
2010-09-30 12:09 svnbot         Note Added: 0127545                          
======================================================================




More information about the asterisk-bugs mailing list