https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3445129dd314c19b6027532019e0e703f0b77c3a

commit 3445129dd314c19b6027532019e0e703f0b77c3a
Author:     Thomas Faber <thomas.fa...@reactos.org>
AuthorDate: Sun Feb 3 16:41:29 2019 +0100
Commit:     Thomas Faber <thomas.fa...@reactos.org>
CommitDate: Sun Feb 17 09:51:16 2019 +0100

    [COMCTL32] Add NULL checks to SetWindowSubclass.
    
    Imports Wine commit 04847e68f87 by Sven Baars.
    
    Fixes crash in comctl32_winetest:subclass.
---
 dll/win32/comctl32/commctrl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dll/win32/comctl32/commctrl.c b/dll/win32/comctl32/commctrl.c
index d4cb73ae76..a3bbd5fc31 100644
--- a/dll/win32/comctl32/commctrl.c
+++ b/dll/win32/comctl32/commctrl.c
@@ -1266,6 +1266,9 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC 
pfnSubclass,
 
    TRACE ("(%p, %p, %lx, %lx)\n", hWnd, pfnSubclass, uIDSubclass, dwRef);
 
+    if (!hWnd || !pfnSubclass)
+        return FALSE;
+
    /* Since the window procedure that we set here has two additional arguments,
     * we can't simply set it as the new window procedure of the window. So we
     * set our own window procedure and then calculate the other two arguments

Reply via email to