Prevent crash in wxString::Mid under STL builds (fixes #1231725).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34811 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1414,11 +1414,12 @@ wxString wxString::Mid(size_t nFirst, size_t nCount) const
|
|||||||
if ( nFirst > nLen )
|
if ( nFirst > nLen )
|
||||||
{
|
{
|
||||||
// AllocCopy() will return empty string
|
// AllocCopy() will return empty string
|
||||||
nCount = 0;
|
return wxEmptyString;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString dest(*this, nFirst, nCount);
|
wxString dest(*this, nFirst, nCount);
|
||||||
if ( dest.length() != nCount ) {
|
if ( dest.length() != nCount )
|
||||||
|
{
|
||||||
wxFAIL_MSG( _T("out of memory in wxString::Mid") );
|
wxFAIL_MSG( _T("out of memory in wxString::Mid") );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user