linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix segfault in libkshark-tepdata
@ 2023-05-17 18:24 Yordan Karadzhov
  2023-05-17 18:30 ` Yordan Karadzhov
  0 siblings, 1 reply; 2+ messages in thread
From: Yordan Karadzhov @ 2023-05-17 18:24 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: rostedt, Yordan Karadzhov

It turns out that the size of the info field of some events can be zero.

Fixing: 3146d0b (kernel-shark: Do not truncate multi-line events)
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=217429
Signed-off-by: Yordan Karadzhov <y.karadz@gmail.com>
---
 src/libkshark-tepdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c
index 2009ca6..b780957 100644
--- a/src/libkshark-tepdata.c
+++ b/src/libkshark-tepdata.c
@@ -825,6 +825,8 @@ static char *get_info_str(struct kshark_data_stream *stream,
 	tep_print_event(kshark_get_tep(stream), &seq, record,
 			"%s", TEP_PRINT_INFO);
 
+	if (!seq.len)
+		return NULL;
 	/*
 	 * The event info string contains a trailing newline.
 	 * Remove this newline.
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix segfault in libkshark-tepdata
  2023-05-17 18:24 [PATCH] Fix segfault in libkshark-tepdata Yordan Karadzhov
@ 2023-05-17 18:30 ` Yordan Karadzhov
  0 siblings, 0 replies; 2+ messages in thread
From: Yordan Karadzhov @ 2023-05-17 18:30 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: rostedt

Please ignore this one.
Thanks!
Y.

On 5/17/23 21:24, Yordan Karadzhov wrote:
> It turns out that the size of the info field of some events can be zero.
> 
> Fixing: 3146d0b (kernel-shark: Do not truncate multi-line events)
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=217429
> Signed-off-by: Yordan Karadzhov <y.karadz@gmail.com>
> ---
>   src/libkshark-tepdata.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c
> index 2009ca6..b780957 100644
> --- a/src/libkshark-tepdata.c
> +++ b/src/libkshark-tepdata.c
> @@ -825,6 +825,8 @@ static char *get_info_str(struct kshark_data_stream *stream,
>   	tep_print_event(kshark_get_tep(stream), &seq, record,
>   			"%s", TEP_PRINT_INFO);
>   
> +	if (!seq.len)
> +		return NULL;
>   	/*
>   	 * The event info string contains a trailing newline.
>   	 * Remove this newline.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-17 18:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-17 18:24 [PATCH] Fix segfault in libkshark-tepdata Yordan Karadzhov
2023-05-17 18:30 ` Yordan Karadzhov

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).