Maarten Lankhorst : kernel32: Fix overflow on 32-bits systems.

Alexandre Julliard julliard at winehq.org
Mon Sep 12 11:42:56 CDT 2011


Module: wine
Branch: master
Commit: 81a6be568e69fd77ff6de4db198d627d8810c1bd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=81a6be568e69fd77ff6de4db198d627d8810c1bd

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Sat Sep 10 11:22:59 2011 +0200

kernel32: Fix overflow on 32-bits systems.

---

 dlls/kernel32/heap.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c
index 598bfe4..db21b7a 100644
--- a/dlls/kernel32/heap.c
+++ b/dlls/kernel32/heap.c
@@ -1204,17 +1204,17 @@ BOOL WINAPI GlobalMemoryStatusEx( LPMEMORYSTATUSEX lpmemex )
 
             /* new style /proc/meminfo ... */
             if (sscanf(buffer, "MemTotal: %lu", &total))
-                lpmemex->ullTotalPhys = total*1024;
+                lpmemex->ullTotalPhys = (ULONG64)total*1024;
             if (sscanf(buffer, "MemFree: %lu", &free))
-                lpmemex->ullAvailPhys = free*1024;
+                lpmemex->ullAvailPhys = (ULONG64)free*1024;
             if (sscanf(buffer, "SwapTotal: %lu", &total))
-                lpmemex->ullTotalPageFile = total*1024;
+                lpmemex->ullTotalPageFile = (ULONG64)total*1024;
             if (sscanf(buffer, "SwapFree: %lu", &free))
-                lpmemex->ullAvailPageFile = free*1024;
+                lpmemex->ullAvailPageFile = (ULONG64)free*1024;
             if (sscanf(buffer, "Buffers: %lu", &buffers))
-                lpmemex->ullAvailPhys += buffers*1024;
+                lpmemex->ullAvailPhys += (ULONG64)buffers*1024;
             if (sscanf(buffer, "Cached: %lu", &cached))
-                lpmemex->ullAvailPhys += cached*1024;
+                lpmemex->ullAvailPhys += (ULONG64)cached*1024;
         }
         fclose( f );
     }




More information about the wine-cvs mailing list