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:
@@ -207,8 +207,8 @@ bool wxStringImpl::AllocBuffer(size_t nLen)
|
||||
wxASSERT( nLen > 0 );
|
||||
|
||||
// make sure that we don't overflow
|
||||
wxASSERT( nLen < (INT_MAX / sizeof(wxStringCharType)) -
|
||||
(sizeof(wxStringData) + EXTRA_ALLOC + 1) );
|
||||
wxCHECK( nLen < (INT_MAX / sizeof(wxStringCharType)) -
|
||||
(sizeof(wxStringData) + EXTRA_ALLOC + 1), false );
|
||||
|
||||
STATISTICS_ADD(Length, nLen);
|
||||
|
||||
|
Reference in New Issue
Block a user