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

Crash in TGaxis::PaintAxis() in certain cases when using time format

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 5.34/34
    • Fix Version/s: 5.34/36, 6.08/00
    • Component/s: Graphics
    • Environment:

      Source code bug, tested in Windows.

    • Platforms:
      x86_64-slc6-gcc48-opt

      Description

      When using time format in axis, TGaxis::PaintAxis() may in some cases call strftime() with invalid parameter causing a crash. Below is a test case that crashes root.exe in Windows using ROOT 5.34/18:

      TGraph graph;
      graph.SetPoint(0, -1, 0);
      graph.GetXaxis()->SetTimeFormat("%y-%m-%d %H:%M%S%F1970-01-01 00:00:00");
      graph.GetXaxis()->SetTimeDisplay(1);
      graph.Draw("AL");

      While the input data is invalid, a crash could be easily avoided by checking return value (demonstrated in https://github.com/tc3t/qoot/commit/51190613d6eae086702ff50830099b736baf8133).

        Attachments

          Activity

            People

            • Assignee:
              couet Olivier Couet
              Reporter:
              395b0cae518753e2a98d tc3t
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: