From 04a7c567572f19f0613408d4711d184bf257cad2 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 26 Jun 1999 11:55:56 +0000 Subject: [PATCH] Added check for invalid parent item. --- dlls/comctl32/treeview.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 6dcfa0a7421..7068eaeab62 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -1389,6 +1389,13 @@ LRESULT WINAPI TREEVIEW_SortChildrenCB( /* Obtain the TVSORTBC struct */ infoPtr->pCallBackSort = (LPTVSORTCB)lParam; + /* Check for a valid handle to the parent item */ + if (!TREEVIEW_ValidItem(infoPtr, infoPtr->pCallBackSort->hParent)) + { + ERR ("invalid item hParent=%d\n", (INT)infoPtr->pCallBackSort->hParent); + return FALSE; + } + /* Obtain the parent node to sort */ sortMe = &infoPtr->items[ (INT)infoPtr->pCallBackSort->hParent ];