Details
-
Bug
-
Status: Closed (View Workflow)
-
Medium
-
Resolution: Fixed
-
5.34/34
-
None
-
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).