Ticket #14380 (closed defect: fixed)

Opened 13 months ago

Last modified 9 months ago

wxThreadEvent can corrupt its wxString member in its copy constructor

Reported by: sodev Owned by:
Priority: normal Milestone:
Component: base Version: 2.9-svn
Keywords: wxThreadEvent Cc:
Blocked By: Patch: yes
Blocking:

Description

wxThreadEvent uses the method c_str() of wxString to create a copy of its wxString member in its copy constructor which truncates the string after the first embedded zero. The attached patch fixes this by using the proper Clone() method instead.

Attachments

wxThreadEventString.patch download (0.5 KB) - added by sodev 13 months ago.

Change History

Changed 13 months ago by sodev

Changed 13 months ago by VZ

  • status changed from new to closed
  • resolution set to fixed

(In [71701]) Use wxString::Clone() instead of c_str() in wxThreadEvent copy ctor.

Creating a new wxString from c_str() of the old one resulted in dropping all
string data after the first embedded NUL. Fix this by using Clone() method
that exists specifically for this purpose. It also makes the code more clear.

Closes #14380.

Changed 9 months ago by VZ

(In [72535]) Credit "sodev" with correct full name.

Amend the change log entry of r71701.

See #14380.

Note: See TracTickets for help on using tickets.