wine/dlls/comctl32 listview.c

Alexandre Julliard julliard at wine.codeweavers.com
Sat Nov 5 04:42:36 CST 2005


ChangeSet ID:	21118
CVSROOT:	/opt/cvs-commit
Module name:	wine
Changes by:	julliard at winehq.org	2005/11/05 04:42:36

Modified files:
	dlls/comctl32  : listview.c 

Log message:
	Dimi Paun <dimi at lattica.com>
	Validate the column index passed in by the caller.

Patch: http://cvs.winehq.org/patch.py?id=21118

Old revision  New revision  Changes     Path
 1.434         1.435         +4 -1       wine/dlls/comctl32/listview.c

Index: wine/dlls/comctl32/listview.c
diff -u -p wine/dlls/comctl32/listview.c:1.434 wine/dlls/comctl32/listview.c:1.435
--- wine/dlls/comctl32/listview.c:1.434	5 Nov 2005 10:42:36 -0000
+++ wine/dlls/comctl32/listview.c	5 Nov 2005 10:42:36 -0000
@@ -5613,6 +5613,7 @@ static BOOL LISTVIEW_GetSubItemRect(LIST
 {
     POINT Position;
     LVITEMW lvItem;
+    INT nColumn = lprc->top;
     
     if (!lprc) return FALSE;
 
@@ -5625,9 +5626,11 @@ static BOOL LISTVIEW_GetSubItemRect(LIST
 
     if (!LISTVIEW_GetItemPosition(infoPtr, nItem, &Position)) return FALSE;
 
+    if (nColumn < 0 || nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE;
+
     lvItem.mask = 0;
     lvItem.iItem = nItem;
-    lvItem.iSubItem = lprc->top;
+    lvItem.iSubItem = nColumn;
     
     if (lvItem.mask && !LISTVIEW_GetItemW(infoPtr, &lvItem)) return FALSE;
     switch(lprc->left)



More information about the wine-cvs mailing list