From 461e38f17c0cfbef365f6a4e9a27768d76b9b244 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 21 Feb 2014 00:51:52 +0000 Subject: [PATCH] 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 --- src/osx/core/display.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osx/core/display.cpp b/src/osx/core/display.cpp index ac512268c4..3fee1fef44 100644 --- a/src/osx/core/display.cpp +++ b/src/osx/core/display.cpp @@ -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]); }