Skip to content

Commit 44e92f8

Browse files
tzstoyanovacmel
authored andcommitted
tools lib traceevent: Add sanity check to is_timestamp_in_us()
This patch adds a sanity check to is_timestamp_in_us() input parameter trace_clock. It avoids a potential segfault in this function for the case trace_clock is NULL. Reported-by: Slavomir Kaslev <kaslevs@vmware.com> Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/20181128145552.68c4f87b@gandalf.local.home Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent a1c8cf2 commit 44e92f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎tools/lib/traceevent/event-parse.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5409,7 +5409,7 @@ void tep_event_info(struct trace_seq *s, struct tep_event_format *event,
54095409

54105410
static bool is_timestamp_in_us(char *trace_clock, bool use_trace_clock)
54115411
{
5412-
if (!use_trace_clock)
5412+
if (!trace_clock || !use_trace_clock)
54135413
return true;
54145414

54155415
if (!strcmp(trace_clock, "local") || !strcmp(trace_clock, "global")

0 commit comments

Comments
 (0)