ucam-department-of-psychiatry / camcops

Cambridge Cognitive and Psychiatric Test Kit (CamCOPS)
Other
12 stars 8 forks source link

Segmentation fault when Kirby task is aborted at start #296

Closed martinburchell closed 1 year ago

martinburchell commented 1 year ago

Seen on Qt6.5 branch but could also a problem with Qt5.12.

Dereferencing the output of max_element() for an empty list gives undefined behaviour.

https://github.com/ucam-department-of-psychiatry/camcops/blob/0c2d3465d5ccc6b28bcd290ba877061782142458/tablet_qt/tasks/kirby.cpp#L368