[PATCH] dplayx: do not use random constant, use sizeof() (Coverity)

Marcus Meissner marcus at jet.franken.de
Sun Sep 29 03:57:09 CDT 2013


1099510 Wrong size argument

original size is larger than the struct size, but use sizeof(DPSESSIONDESC2)
here, the struct does not seem variable.

CIao, MArcus
---
 dlls/dplayx/tests/dplayx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/dplayx/tests/dplayx.c b/dlls/dplayx/tests/dplayx.c
index 44c9b50..f0f1e03 100644
--- a/dlls/dplayx/tests/dplayx.c
+++ b/dlls/dplayx/tests/dplayx.c
@@ -1695,7 +1695,7 @@ static void test_SessionDesc(void)
         /* Players, only to receive messages */
         IDirectPlayX_CreatePlayer( pDP[i], &dpid[i], NULL, NULL, NULL, 0, 0 );
 
-        lpData[i] = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 1024 );
+        lpData[i] = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DPSESSIONDESC2) );
     }
     lpDataMsg = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 1024 );
 
-- 
1.7.10.4




More information about the wine-patches mailing list