#15718 closed defect (fixed)

wxSymbolPickerDialog crashes on ampersand character

Reported by: ikamakj Owned by:
Priority: normal Milestone:
Component: wxRichText Version: 2.9.5
Keywords: wxSymbolPickerDialog ampersand Cc:
Blocked By: Blocking:
Patch: no

Description

wxSymbolPickerDialog::UpdateSymbolDisplay() incorrectly uses SetLabel() to update the character shown in the static control. If the user happens to select the ampersand, SetLabel() interprets it as the escape character for a mnemonic, but there is no character following the ampersand. This results in a crash on non-Windows platforms (observed on wxOSX/Carbon) where the ampersand must be removed with wxStripMenuCodes() before passing the text to an OS function. The correct function to call here would be SetLabelText().

It might be a good idea anyway to correct wxStripMenuCodes() so as avoid a crash in case an ampersand incorrectly occurs at the end of the string.

Change History (1)

comment:1 Changed 12 months ago by juliansmart

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in trunk and 3.0, thanks.

Note: See TracTickets for help on using tickets.