[ROOT-8116] TText::Copy utterly broken in all cases Created: 13/Apr/16  Updated: 14/Apr/16  Resolved: 14/Apr/16

Status: Closed
Project: ROOT
Component/s: None
Affects Version/s: 5.34/36, 6.06/02
Fix Version/s: 6.08/00, 5.34/38

Type: Bug Priority: High
Reporter: Oliver Freyermuth Assignee: Olivier Couet
Resolution: Fixed Votes: 0
Labels: None
Environment:

Gentoo Linux x86_64


Attachments: File textcopy.tar.gz    
Development:

 Description   

Dear ROOTers,

TText::Copy (and subsequently, the copy constructor, and all copy constructors of inheriting classes, such as TLatex) are utterly broken.
First off, the order of copying is done wrong for the wide-character name is missing,
and secondly, nullptr checks are missing.

For that reason, TText::Copy fails for both the case of a text with wchar and with normal char.

I attach an example, with makefile, illustrating the issue for both cases.

I also have a patch which survives the testcase which I sent as PR - I'll add the PR-number + link in a comment soon.

It would be nice if this bugfix could be applied to the ROOT 5 base, too.

Cheers,
Oliver



 Comments   
Comment by Oliver Freyermuth [ 13/Apr/16 ]

The corresponding PR is #160 :
https://github.com/root-mirror/root/pull/160

Cheers,
Oliver

Comment by Olivier Couet [ 14/Apr/16 ]

Fixed Thanks.

Generated at Sun Sep 22 01:32:00 CEST 2019 using Jira 7.13.1#713001-sha1:5e06076c2d215a6f699b7e5c90ab2fae7ba5a1ce.