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. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx> --- lib/trace-cmd/trace-input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c index 513f6cc3..c0b47345 100644 --- a/lib/trace-cmd/trace-input.c +++ b/lib/trace-cmd/trace-input.c @@ -2703,7 +2703,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); -- 2.30.2