Details
-
Bug
-
Status: Closed (View Workflow)
-
High
-
Resolution: Fixed
-
master
-
None
-
doesn't matter
Description
Return pointer to function local data:
======================================
TQCommand::GetName and GetTitle
Both return local TString.Data()!
How to fix? (does it have to be thread safe?)
file: core/base/src/TQCommand.cxx:698:4 clang-analyzer-core.StackAddressEscape
error: Address of stack memory associated with local variable 'name' returned to caller
return name.Data();
^
file: core/base/src/TQCommand.cxx:717:4 clang-analyzer-core.StackAddressEscape
error: Address of stack memory associated with local variable 'title' returned to caller
return title.Data();
^