View Issue Details

IDProjectCategoryView StatusLast Update
0002182ardourbugspublic2008-04-14 11:54
Reporterjwrdegoede Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.1 
Summary0002182: PATCH: fix a nullpointer dereference
DescriptionThis patch fixes a possible null pointer dereference / illigal memory access which can happen when allocating a 0 bytes block.
TagsNo tags attached.

Activities

2008-04-07 14:02

 

ardour-session.cc-no_stomp.patch (610 bytes)   
--- libs/ardour/session.cc~	2006-05-14 09:53:33.000000000 -0700
+++ libs/ardour/session.cc	2006-05-14 10:20:11.000000000 -0700
@@ -3218,7 +3218,8 @@
 #endif			
 		_passthru_buffers.push_back (p);
 
-		*p = 0;
+		if (current_block_size > 0)
+		  *p = 0;
 		
 #ifdef NO_POSIX_MEMALIGN
 		p =  (Sample *) malloc(current_block_size * sizeof(Sample));
@@ -3228,7 +3229,8 @@
 		memset (p, 0, sizeof (Sample) * current_block_size);
 		_silent_buffers.push_back (p);
 
-		*p = 0;
+		if (current_block_size > 0)
+		  *p = 0;
 		
 #ifdef NO_POSIX_MEMALIGN
 		p =  (Sample *) malloc(current_block_size * sizeof(Sample));

timbyr

2008-04-08 11:12

developer   ~0004843

I don't think this patch is required as of 2.0-ongoing@2983(before 2.3) which prevents trying to allocate a 0 byte size block in Session::ensure_passthru_buffers

jwrdegoede

2008-04-08 11:16

reporter   ~0004844

> I don't think this patch is required as of 2.0-ongoing@2983(before 2.3) which
> prevents trying to allocate a 0 byte size block in
> Session::ensure_passthru_buffers

That could be very well possible (I didn't write this patch, I'm merely forwarding it), still it can't hurt to double check.

timbyr

2008-04-14 11:54

developer   ~0004860

The patch is no longer needed as of rev 2.0-ongoing@2983

Issue History

Date Modified Username Field Change
2008-04-07 14:02 jwrdegoede New Issue
2008-04-07 14:02 jwrdegoede File Added: ardour-session.cc-no_stomp.patch
2008-04-08 11:12 timbyr Note Added: 0004843
2008-04-08 11:16 jwrdegoede Note Added: 0004844
2008-04-14 11:54 timbyr Status new => closed
2008-04-14 11:54 timbyr Note Added: 0004860
2008-04-14 11:54 timbyr Resolution open => fixed