Fix crash when setting invalid label with "&" at the end.

We detected that the label was invalid and gave a debug warning message about
it but then still proceeded to crash by accessing the data beyond the end of
the string. Don't do this.

Closes #15665.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2013-11-13 12:53:10 +00:00
parent 9b31387508
commit a7ec1d1cdf
2 changed files with 10 additions and 0 deletions

View File

@ -570,6 +570,15 @@ Major new features in this release
was added.
3.0.1: (released 2014-xx-xx)
----------------------------
All (GUI):
- Fix crash when setting invalid label ending with "&" (ZaneUJi).
3.0.0: (released 2013-11-11)
----------------------------

View File

@ -1205,6 +1205,7 @@ wxString wxStripMenuCodes(const wxString& in, int flags)
if ( ++it == in.end() )
{
wxLogDebug(wxT("Invalid menu string '%s'"), in.c_str());
break;
}
else
{