[openib-general] [PATCH] OpenSM/complib: Fix memory corruption in cl_pool.c:cl_qcpool_init

Hal Rosenstock halr at voltaire.com
Thu Jul 20 08:50:16 PDT 2006


OpenSM/complib: Fix memory corruption in cl_pool.c:cl_qcpool_init 

This affects big endian 64-bit architectures (it's covered up on little
endian 64-bit architectures).

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: complib/cl_pool.c
===================================================================
--- complib/cl_pool.c	(revision 8616)
+++ complib/cl_pool.c	(working copy)
@@ -131,7 +131,7 @@ cl_qcpool_init(
 
 	/* Copy the user's sizes into our array for future use. */
 	memcpy( p_pool->component_sizes, component_sizes,
-		sizeof(uint32_t) * num_components );
+		sizeof(component_sizes[0]) * num_components );
 
 	/* Store the number of components per object. */
 	p_pool->num_components = num_components;







More information about the general mailing list