[asterisk-commits] jpeeler: branch 1.6.2 r243247 - in /branches/1.6.2: ./ main/frame.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 26 12:16:24 CST 2010


Author: jpeeler
Date: Tue Jan 26 12:16:19 2010
New Revision: 243247

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=243247
Log:
Merged revisions 243244 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r243244 | jpeeler | 2010-01-26 12:07:57 -0600 (Tue, 26 Jan 2010) | 12 lines
  
  Fix crash resulting from frames with invalid data pointers.
  
  In ast_frdup the frame data union does not get set to point to malloced memory 
  if the datalen is zero, so make sure to handle the same case in ast_frisolate
  appropriately.
  
  (closes issue #16058)
  Reported by: atis
  Patches: 
        bug16058-fix.patch uploaded by jpeeler (license 325)
  Tested by: atis
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/main/frame.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/main/frame.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/frame.c?view=diff&rev=243247&r1=243246&r2=243247
==============================================================================
--- branches/1.6.2/main/frame.c (original)
+++ branches/1.6.2/main/frame.c Tue Jan 26 12:16:19 2010
@@ -441,6 +441,11 @@
 	}
 	
 	if (!(fr->mallocd & AST_MALLOCD_DATA))  {
+		if (!fr->datalen) {
+			out->data.uint32 = fr->data.uint32;
+			out->mallocd = AST_MALLOCD_HDR | AST_MALLOCD_SRC;
+			return out;
+		}
 		if (!(newdata = ast_malloc(fr->datalen + AST_FRIENDLY_OFFSET))) {
 			if (out->src != fr->src) {
 				ast_free((void *) out->src);




More information about the asterisk-commits mailing list