Juan Lang : user32: Don't crash if passed a non-scrollbar HWND. Fixes Coverity id 265.

Alexandre Julliard julliard at winehq.org
Fri Sep 12 07:01:19 CDT 2008


Module: wine
Branch: master
Commit: 6049ad74e9d2c44154fad1b6e1de7aed4c299ec8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6049ad74e9d2c44154fad1b6e1de7aed4c299ec8

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Sep 11 09:21:43 2008 -0700

user32: Don't crash if passed a non-scrollbar HWND. Fixes Coverity id 265.

---

 dlls/user32/scroll.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/user32/scroll.c b/dlls/user32/scroll.c
index af35c97..5556315 100644
--- a/dlls/user32/scroll.c
+++ b/dlls/user32/scroll.c
@@ -1256,7 +1256,9 @@ static BOOL SCROLL_GetScrollBarInfo(HWND hwnd, LONG idObject, LPSCROLLBARINFO in
     info->xyThumbBottom = info->xyThumbTop + info->dxyLineButton;
 
     infoPtr = SCROLL_GetInternalInfo(hwnd, nBar, TRUE);
-    
+    if (!infoPtr)
+        return FALSE;
+
     /* Scroll bar state */
     info->rgstate[0] = 0;
     if ((nBar == SB_HORZ && !(style & WS_HSCROLL))




More information about the wine-cvs mailing list