From dfaae3e640da198acdb53394c1a4110b76431c77 Mon Sep 17 00:00:00 2001 From: Michael Wetherell Date: Thu, 4 Oct 2007 12:50:49 +0000 Subject: [PATCH] Fix wxString::replace when nLen is wxString::npos. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/stringimpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/stringimpl.cpp b/src/common/stringimpl.cpp index 95d6863..c879944 100644 --- a/src/common/stringimpl.cpp +++ b/src/common/stringimpl.cpp @@ -584,7 +584,7 @@ wxStringImpl& wxStringImpl::replace(size_t nStart, size_t nLen, wxASSERT_MSG( nStart <= lenOld, _T("index out of bounds in wxStringImpl::replace") ); size_t nEnd = nStart + nLen; - if ( nEnd > lenOld ) + if ( nLen > lenOld - nStart ) { // nLen may be out of range, as it can be npos, just clump it down nLen = lenOld - nStart; -- 2.7.4