From 619b3b447abc10ec6bfcbfee90ec375aefdb68c0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 5 Apr 2008 17:54:02 +0000 Subject: [PATCH] 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 --- src/common/string.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/string.cpp b/src/common/string.cpp index 12e8525613..e9ca33871f 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -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);