[PATCH] dplayx: Check array index limit first.

Andrey Gusev andrey.goosev at gmail.com
Wed May 16 04:37:59 CDT 2018


Signed-off-by: Andrey Gusev <andrey.goosev at gmail.com>
---
 dlls/dplayx/dplayx_global.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/dplayx/dplayx_global.c b/dlls/dplayx/dplayx_global.c
index 14c53a0c8d..90c3ed8d7e 100644
--- a/dlls/dplayx/dplayx_global.c
+++ b/dlls/dplayx/dplayx_global.c
@@ -120,7 +120,7 @@ static LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size )
 
   /* Find blank area */
   uBlockUsed = 0;
-  while( lpMemArea[ uBlockUsed ].used && uBlockUsed <= dwMaxBlock ) { uBlockUsed++; }
+  while( uBlockUsed <= dwMaxBlock && lpMemArea[ uBlockUsed ].used ) { uBlockUsed++; }
 
   if( uBlockUsed <= dwMaxBlock )
   {
-- 
2.14.3




More information about the wine-devel mailing list