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

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

    XMLWordPrintable

    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
    • Labels:
      None
    • Environment:

      Source code bug, tested in Windows.

      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 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: