Potential dandling pointers when using TQString as temporary object #7

Open
opened 5 years ago by MicheleC · 0 comments
Owner

As per discussion in ML and IRC, when TQString is a temporary object, calling ascii(), latin1(), utf8() and local8bit() can result in dandling pointers.

We should look at a solution that prevents this, for example by using shared pointers instead of const char* for the return type.

This will require API changes and probably quite a bit of work to update all the usage across TDE.

We should also consider whether to make latin1() an internal function and whether we should use utf8 format instead of unicode as base for storage.

As per discussion in ML and IRC, when TQString is a temporary object, calling ascii(), latin1(), utf8() and local8bit() can result in dandling pointers. We should look at a solution that prevents this, for example by using shared pointers instead of const char* for the return type. This will require API changes and probably quite a bit of work to update all the usage across TDE. We should also consider whether to make latin1() an internal function and whether we should use utf8 format instead of unicode as base for storage.
MicheleC added this to the R14.2.0 release milestone 5 years ago
MicheleC modified the milestone from R14.2.0 release to R14.2.x 1 year ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: TDE/tqt3#7
Loading…
There is no content yet.