X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d545bdede67c1f4335e6b4822dfcad3775f631fc..82c126e50158efee5a1f46e1200be380c5199f8d:/src/common/stringimpl.cpp diff --git a/src/common/stringimpl.cpp b/src/common/stringimpl.cpp index 95d6863301..c8799442c3 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;