[Home]

Summary:ASTERISK-14959: [patch] reference argument sub in handle_transfer_button after we check it
Reporter:Elazar Broad (ebroad)Labels:
Date Opened:2009-10-07 23:56:30Date Closed:2009-12-04 10:26:43.000-0600
Priority:TrivialRegression?No
Status:Closed/CompleteComponents:Channels/chan_skinny
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) skinnynulltransfer.diff
Description:Currently, we reference sub before we check if it is null or not, this can lead to a segfault if we attempt to transfer a non-existent channel.

****** ADDITIONAL INFORMATION ******

The attached patch moves the reference below the if(...) statement that performs the check.
Comments:By: Damien Wedhorn (wedhorn) 2009-11-10 14:08:37.000-0600

The coding guidelines indicate that the variable definition needs to go at the beginning of the block. But you are correct that the assignment needs to go after the test. This is a segfault waiting to happen.

By: Digium Subversion (svnbot) 2009-12-04 10:26:42.000-0600

Repository: asterisk
Revision: 233059

U   trunk/channels/chan_skinny.c

------------------------------------------------------------------------
r233059 | mvanbaak | 2009-12-04 10:26:42 -0600 (Fri, 04 Dec 2009) | 5 lines

Only assign line and device in handle_transfer_button when we have a subchannel.

(closes issue ASTERISK-14959)
Reported by: ebroad

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

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