From f627cb7ceda1b52e3e97e23f5d727dfe29f21fbb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 13 Nov 2013 12:52:30 +0000 Subject: [PATCH] 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/branches/WX_3_0_BRANCH@75179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 9 +++++++++ src/common/utilscmn.cpp | 1 + 2 files changed, 10 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index bc57b6eb0e..81ef7b5700 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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) ---------------------------- diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index f3a77d4161..0d30b0249b 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -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 {