[asterisk-bugs] [Asterisk 0013858]: [patch] On memory allocation failure return NULL or we will crash.

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Nov 18 19:00:08 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13858 
====================================================================== 
Reported By:                eliel
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13858
Category:                   Core/AstMM
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 155240 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-11-07 05:18 CST
Last Modified:              2008-11-18 19:00 CST
====================================================================== 
Summary:                    [patch] On memory allocation failure return NULL or
we will crash.
Description: 
ast_alloc_region needs to give up (return NULL) if the ast_region structure
couldn't be allocated or asterisk will crash while trying the next line:

ast_copy_string(reg->file, file, sizeof(reg->file));
====================================================================== 

---------------------------------------------------------------------- 
 (0095039) svnbot (reporter) - 2008-11-18 19:00
 http://bugs.digium.com/view.php?id=13858#c95039 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 157632

U   trunk/main/astmm.c

------------------------------------------------------------------------
r157632 | mmichelson | 2008-11-18 19:00:07 -0600 (Tue, 18 Nov 2008) | 10
lines

If malloc returns NULL, we need to  return NULL immediately or
else Asterisk will crash when attempting to dereference the NULL
pointer

(closes issue http://bugs.digium.com/view.php?id=13858)
Reported by: eliel
Patches:
      astmm.c.patch uploaded by eliel (license 64)


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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-11-18 19:00 svnbot         Checkin                                      
2008-11-18 19:00 svnbot         Note Added: 0095039                          
======================================================================




More information about the asterisk-bugs mailing list