comctl32: Return false if index is out of bounds in GetItemT

Vitaliy Margolen wine-patch at kievinfo.com
Thu Nov 17 00:21:57 CST 2005



Vitaliy Margolen

changelog:
  comctl32
  - Return false if index is out of bounds in GetItemT
-------------- next part --------------
Index: dlls/comctl32/header.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/header.c,v
retrieving revision 1.88
diff -u -p -r1.88 header.c
--- dlls/comctl32/header.c	15 Nov 2005 16:54:41 -0000	1.88
+++ dlls/comctl32/header.c	17 Nov 2005 06:20:49 -0000
@@ -813,11 +813,10 @@ HEADER_GetItemT (HWND hwnd, INT nItem, L
 
     if (phdi->mask == 0)
 	return TRUE;
-
     if ((nItem < 0) || (nItem >= (INT)infoPtr->uNumItem))
-        lpItem = NULL;
-    else
-        lpItem = &infoPtr->items[nItem];
+        return FALSE;
+
+    lpItem = &infoPtr->items[nItem];
 
     if (phdi->mask & HDI_BITMAP)
 	phdi->hbm = (lpItem != NULL) ? lpItem->hbm : 0;


More information about the wine-patches mailing list