aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>2021-03-25 08:40:55 +0200
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2021-03-26 17:23:41 -0400
commit1c24094c0525a1be1ade9511f85afd367ee26555 (patch)
tree387ea86aaffc24a7981094a3b8ac10af87be20cb
parente0f24a3996a35e9c5d30198a75dc906ad5a64948 (diff)
downloadtrace-cmd-stable-v2.9.tar.gz
trace-cmd: Read at least 8 bytes trace-id optiontrace-cmd-stable-v2.9
When reading the trace-id option from trace.dat file, check if the size is at least 8 bytes. If the size is greater, use the first 8 bytes only and ignore the rest. That way we can safely extend this option in the future, without breaking the legacy logic. Link: https://lore.kernel.org/linux-trace-devel/20210325064055.539554-24-tz.stoyanov@gmail.com Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r--lib/trace-cmd/trace-input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index 2093a3dc..51b96035 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -2666,7 +2666,7 @@ static int handle_options(struct tracecmd_input *handle)
trace_pid_map_load(handle, buf);
break;
case TRACECMD_OPTION_TRACEID:
- if (size != 8)
+ if (size < 8)
break;
handle->trace_id = tep_read_number(handle->pevent,
buf, 8);