Added check for invalid parent item.

oldstable
Eric Kohl 1999-06-26 11:55:56 +00:00 committed by Alexandre Julliard
parent 45f888664d
commit 04a7c56757
1 changed files with 7 additions and 0 deletions

View File

@ -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 ];