]> git.saurik.com Git - wxWidgets.git/commitdiff
Range check the index in GetString
authorRobin Dunn <robin@alldunn.com>
Sat, 26 Feb 2005 00:18:24 +0000 (00:18 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 26 Feb 2005 00:18:24 +0000 (00:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32375 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/listbox.cpp

index a9d1246fae208c7b237d7eeee5590f944e7945ee..aba639219e2e0e982df2b7fd314cae4d5b69047b 100644 (file)
@@ -519,7 +519,10 @@ int wxListBox::GetSelection() const
 // Find string for position
 wxString wxListBox::GetString(int N) const
 {
-       return m_stringArray[N]  ;
+    wxCHECK_MSG( N >= 0 && N < m_noItems, wxEmptyString,
+                 wxT("invalid index in wxListBox::GetString") );
+
+    return m_stringArray[N]  ;
 }
 
 void wxListBox::DoInsertItems(const wxArrayString& items, int pos)