X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e66eb2dfae8805989fddd8ad5ffceb3333f5cfdc..fc2d42090058bb7ebb9545b857a9a435ecbdd876:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index 5770917d5f..c2bab603e2 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -174,8 +174,16 @@ void wxStringBase::InitWith(const wxChar *psz, size_t nPos, size_t nLength) // poor man's iterators are "void *" pointers wxStringBase::wxStringBase(const void *pStart, const void *pEnd) { - InitWith((const wxChar *)pStart, 0, - (const wxChar *)pEnd - (const wxChar *)pStart); + if ( pEnd >= pStart ) + { + InitWith((const wxChar *)pStart, 0, + (const wxChar *)pEnd - (const wxChar *)pStart); + } + else + { + wxFAIL_MSG( _T("pStart is not before pEnd") ); + Init(); + } } wxStringBase::wxStringBase(size_type n, wxChar ch)