Commit 9b9fef2e authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

comctl32: Check reference data pointer before using it.

Fix the crash when opening notepad++ v8.4.4 preference dialog before e52e42b8.
parent f7443102
......@@ -1179,7 +1179,8 @@ BOOL WINAPI GetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
while (proc) {
if ((proc->id == uID) &&
(proc->subproc == pfnSubclass)) {
*pdwRef = proc->ref;
if (pdwRef)
*pdwRef = proc->ref;
return TRUE;
}
proc = proc->next;
......
......@@ -371,12 +371,8 @@ static void test_GetWindowSubclass(void)
todo_wine
ok(data == 0, "Got unexpected data %#Ix.\n", data);
/* Crash on Wine */
if (strcmp(winetest_platform, "wine"))
{
ret = pGetWindowSubclass(hwnd, wnd_proc_sub, 2, NULL);
ok(ret, "GetWindowSubclass failed.\n");
}
data = 0xdeadbeef;
ret = pGetWindowSubclass(hwnd, wnd_proc_sub, 2, &data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment