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@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-03-26 15:31:21 +01:00
parent 9bbb66fdf7
commit 64bd952b85

View file

@ -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 );