]> git.saurik.com Git - wxWidgets.git/commitdiff
GetNextItem() now checks for item < GetItemCount() to avoid illegal
authorKarsten Ballüder <ballueder@usa.net>
Thu, 25 Feb 1999 10:32:48 +0000 (10:32 +0000)
committerKarsten Ballüder <ballueder@usa.net>
Thu, 25 Feb 1999 10:32:48 +0000 (10:32 +0000)
wxList access beyond end of list.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1785 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp

index 01afffd3fe9fcab9b08735964da8fcc40bc3d508..600a0fccd61221fbcbefbaf0cb941353f21bdd9b 100644 (file)
@@ -2033,6 +2033,7 @@ long wxListMainWindow::GetNextItem( long item, int WXUNUSED(geometry), int state
 {
     long ret = 0;
     if (item > 0) ret = item;
+    if(item >= GetItemCount()) return -1;
     wxNode *node = m_lines.Nth( ret );
     while (node)
     {