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/trunk@53031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-04-05 17:54:02 +00:00
parent 0367b92891
commit a0b7b49350

View File

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