Avoid dereferencing invalid iterator in wxMessageDialog code.
The iterator wxString::rbegin().base()+1 is invalid so check that we don't use it. Closes #13126. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -253,8 +253,10 @@ void wxMessageDialog::ReplaceStaticWithEdit()
|
|||||||
{
|
{
|
||||||
if ( *i != '\n' )
|
if ( *i != '\n' )
|
||||||
{
|
{
|
||||||
// found last non-newline char, remove everything after it and stop
|
// found last non-newline char, remove anything after it if
|
||||||
text.erase(i.base() + 1, text.end());
|
// necessary and stop in any case
|
||||||
|
if ( i != text.rbegin() )
|
||||||
|
text.erase(i.base() + 1, text.end());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user