Mikołaj Zalewski : kernel32: Clear the extra memory in LocalReAlloc16(h, bigger_size, LMEM_ZEROINIT).

Alexandre Julliard julliard at wine.codeweavers.com
Wed May 30 08:56:56 CDT 2007


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

Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date:   Wed May 30 10:06:34 2007 +0200

kernel32: Clear the extra memory in LocalReAlloc16(h, bigger_size, LMEM_ZEROINIT).

---

 dlls/kernel32/local16.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/local16.c b/dlls/kernel32/local16.c
index eb8df76..76b2a6d 100644
--- a/dlls/kernel32/local16.c
+++ b/dlls/kernel32/local16.c
@@ -1330,6 +1330,9 @@ HLOCAL16 WINAPI LocalReAlloc16( HLOCAL16 handle, WORD size, UINT16 flags )
     {
 	TRACE("size increase, making new free block\n");
         LOCAL_GrowArenaUpward(ds, arena, nextarena - arena);
+        if (flags & LMEM_ZEROINIT)
+            memset((char *)pArena + oldsize, 0, size - oldsize);
+
         TRACE("returning %04x\n", handle );
         return handle;
     }




More information about the wine-cvs mailing list