use wxCHECK instead of wxASSERT in Alloc() to avoid crashing when (trying to) use strings of length close to INT_MAX (bug 1933693)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-04-05 17:54:02 +00:00
parent c336299eb6
commit 619b3b447a

View File

@@ -209,8 +209,8 @@ bool wxStringBase::AllocBuffer(size_t nLen)
wxASSERT( nLen > 0 );
// make sure that we don't overflow
wxASSERT( nLen < (INT_MAX / sizeof(wxChar)) -
(sizeof(wxStringData) + EXTRA_ALLOC + 1) );
wxCHECK( nLen < (INT_MAX / sizeof(wxChar)) -
(sizeof(wxStringData) + EXTRA_ALLOC + 1), false );
STATISTICS_ADD(Length, nLen);