[asterisk-bugs] [Asterisk 0012609]: potential segfault if tmpchan is NULL

noreply at bugs.digium.com noreply at bugs.digium.com
Thu May 8 10:19:14 CDT 2008


The following issue has been ASSIGNED. 
====================================================================== 
http://bugs.digium.com/view.php?id=12609 
====================================================================== 
Reported By:                edantie
Assigned To:                russell
====================================================================== 
Project:                    Asterisk
Issue ID:                   12609
Category:                   Core/PBX
Reproducibility:            N/A
Severity:                   trivial
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 115517 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             05-08-2008 05:22 CDT
Last Modified:              05-08-2008 10:19 CDT
====================================================================== 
Summary:                    potential segfault if tmpchan is NULL
Description: 
in pbx.c
In pbx.c

function:

int ast_async_goto(struct ast_channel *chan, const char *context, const
char *exten, int priority)



04611       struct ast_channel *tmpchan = ast_channel_alloc(0,
chan->_state, 0, 0, chan->accountcode, chan->exten, chan->context,
chan->amaflags, "AsyncGoto/%s", chan->name);
04612       if (chan->cdr) {
04613          ast_cdr_discard(tmpchan->cdr);
04614          tmpchan->cdr = ast_cdr_dup(chan->cdr);  /* share the love
*/
04615       }
04616       if (!tmpchan)
04617          res = -1;
04618       else {


lines 4612-4615  should be moved after 4618
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 05-08-08 10:19  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 115551

U   branches/1.4/main/pbx.c

------------------------------------------------------------------------
r115551 | russell | 2008-05-08 10:19:12 -0500 (Thu, 08 May 2008) | 4 lines

Don't use a channel before checking for channel allocation failure.
(closes issue http://bugs.digium.com/view.php?id=12609)
Reported by: edantie

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

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

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
05-08-08 10:19  svnbot         Checkin                                      
05-08-08 10:19  svnbot         Note Added: 0086598                          
05-08-08 10:19  svnbot         Status                   new => assigned     
05-08-08 10:19  svnbot         Assigned To               => russell         
======================================================================




More information about the asterisk-bugs mailing list