Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9241

Address of stack memory associated with local variable returned to caller

    XMLWordPrintable

Details

    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();
      ^

      Attachments

        Activity

          People

            pcanal Philippe Canal
            5ec16ad4cd4ea320131c Wolf Behrenhoff
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: