Ensure we don't read invalid memory in wxOSX wxDisplay code.

Replace wxASSERT() with wxCHECK_MSG() to ensure that we don't read beyond the
end of the array even if we are given an invalid index.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75957 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-02-21 00:51:52 +00:00
parent 563f41c686
commit 461e38f17c

View File

@ -181,7 +181,7 @@ wxDisplayImpl *wxDisplayFactoryMacOSX::CreateDisplay(unsigned n)
CGDisplayErr err = wxOSXGetDisplayList(theCount, theIDs, &theCount);
wxCHECK_MSG( err == CGDisplayNoErr, NULL, "wxOSXGetDisplayList() failed" );
wxASSERT( n < theCount );
wxCHECK_MSG( n < theCount, NULL, wxS("Invalid display index") );
return new wxDisplayImplMacOSX(n, theIDs[n]);
}