kernelshark: Avoid nullptr deref in _graphFollowsChanged
PATCH 1/1 kernelshark: Avoid nullptr deref in _graphFollowsChanged
In _graphFollowsChanged, _it will be null as long as the search function is not used.
Use row instead to send a signal to the graph widget when toggling the "Graph follows" checkbox to avoid a nullptr dereference / segfault. This will also make sure the marker on the graph points to the correct event when the user selects another event afer using the search function.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=219637
Signed-off-by Ruben Devos <[email protected]>
--- src/KsTraceViewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/KsTraceViewer.cpp +1 -1
@@ -311,7 +311,7 @@ void KsTraceViewer::_graphFollowsChanged(int state) _graphFollows = (bool) state; if (_graphFollows && row != KS_NO_ROW_SELECTED) - emit select(*_it); // Send a signal to the Graph widget. + emit select(row); // Send a signal to the Graph widget. } void KsTraceViewer::_search()
Signature · 1 line
2.47.1