Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-16981

StringAttr::set() of self could cause problems

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2.6
    • Component/s: JLib
    • Labels:
      None

      Description

      Currently the following code will access invalid memory:

      StringAttr x("Hello");
      x.set(x);
      

      The StringAttr code needs to free up the old string after the new one has been set, otherwise an assignment of an object to itself could corrupt the contents.

        Attachments

          Activity

            People

            • Assignee:
              ghalliday Gavin Halliday
              Reporter:
              ghalliday Gavin Halliday
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: