Alexandre Julliard : user.exe: Clear out the thunk array to catch invalid winprocs.

Alexandre Julliard julliard at winehq.org
Thu Mar 26 16:27:23 CDT 2020


Module: wine
Branch: master
Commit: 64bd952b85eb183d97b438a3d2695b2bf78d17ea
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=64bd952b85eb183d97b438a3d2695b2bf78d17ea

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Mar 26 15:31:21 2020 +0100

user.exe: Clear out the thunk array to catch invalid winprocs.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48814
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user.exe16/message.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/user.exe16/message.c b/dlls/user.exe16/message.c
index 14e7a19889..e3ca3fd779 100644
--- a/dlls/user.exe16/message.c
+++ b/dlls/user.exe16/message.c
@@ -152,7 +152,8 @@ static WNDPROC16 alloc_win16_thunk( WNDPROC handle )
     {
         assert( MAX_WINPROCS16 * sizeof(WINPROC_THUNK) <= 0x10000 );
 
-        if (!(thunk_selector = GlobalAlloc16( GMEM_FIXED, MAX_WINPROCS16 * sizeof(WINPROC_THUNK) )))
+        if (!(thunk_selector = GlobalAlloc16( GMEM_FIXED | GMEM_ZEROINIT,
+                                              MAX_WINPROCS16 * sizeof(WINPROC_THUNK) )))
             return NULL;
         PrestoChangoSelector16( thunk_selector, thunk_selector );
         thunk_array = GlobalLock16( thunk_selector );




More information about the wine-cvs mailing list