linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernelshark: Avoid nullptr deref in _graphFollowsChanged
@ 2024-12-29 19:21 Ruben Devos
  0 siblings, 0 replies; only message in thread
From: Ruben Devos @ 2024-12-29 19:21 UTC (permalink / raw)
  To: linux-trace-devel, y.karadz; +Cc: Ruben Devos

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 <devosruben6@gmail.com>
---
 src/KsTraceViewer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/KsTraceViewer.cpp b/src/KsTraceViewer.cpp
index d4bf5f1..6efba7d 100644
--- a/src/KsTraceViewer.cpp
+++ b/src/KsTraceViewer.cpp
@@ -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()
-- 
2.47.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-12-29 19:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-29 19:21 [PATCH] kernelshark: Avoid nullptr deref in _graphFollowsChanged Ruben Devos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).