From a3a19355cdcb2ae2e89375b2b5d4cb0540f7b0a1 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Thu, 12 Aug 2004 20:01:55 +0000 Subject: [PATCH] Prevent listview from crashing when a null sort function is passed to LVM_SORTITEMS. --- dlls/comctl32/listview.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index fae74b1bfac..bdb21ae665d 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -7272,6 +7272,7 @@ static BOOL LISTVIEW_SortItems(LISTVIEW_INFO *infoPtr, PFNLVCOMPARE pfnCompare, if (infoPtr->dwStyle & LVS_OWNERDATA) return FALSE; + if (!pfnCompare) return FALSE; if (!infoPtr->hdpaItems) return FALSE; /* if there are 0 or 1 items, there is no need to sort */