Opened 23 months ago

Closed 23 months ago

Last modified 19 months ago

#14380 closed defect (fixed)

wxThreadEvent can corrupt its wxString member in its copy constructor

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

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 (1)

wxThreadEventString.patch download (513 bytes) - added by sodev 23 months ago.

Download all attachments as: .zip

Change History (3)

Changed 23 months ago by sodev

comment:1 Changed 23 months ago by VZ

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

(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.

comment:2 Changed 19 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.