From a0b7b493504f8ef023962f0282eeef3bca5600f9 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/trunk@53031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/stringimpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/stringimpl.cpp b/src/common/stringimpl.cpp index e182044be1..d626556df9 100644 --- a/src/common/stringimpl.cpp +++ b/src/common/stringimpl.cpp @@ -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); -- 2.45.2