[COMCTL32] Check for NULL pointer when handling BCM_GETIDEALSIZE.
authorThomas Faber <thomas.faber@reactos.org>
Sun, 3 Feb 2019 15:55:04 +0000 (16:55 +0100)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 17 Feb 2019 08:51:18 +0000 (09:51 +0100)
Fixes crash in comctl32_winetest:button.

dll/win32/comctl32/button.c

index 5906747..1d7431d 100644 (file)
@@ -941,6 +941,11 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
         BOOL ret = FALSE;
         SIZE* pSize = (SIZE*)lParam;
 
         BOOL ret = FALSE;
         SIZE* pSize = (SIZE*)lParam;
 
+        if (!pSize)
+        {
+            return FALSE;
+        }
+
         if (btn_type == BS_PUSHBUTTON || 
             btn_type == BS_DEFPUSHBUTTON ||
             btn_type == BS_USERBUTTON)
         if (btn_type == BS_PUSHBUTTON || 
             btn_type == BS_DEFPUSHBUTTON ||
             btn_type == BS_USERBUTTON)