From 94a0f57a62856c3bf3e427f6694a5a40f57f8d4d Mon Sep 17 00:00:00 2001 From: Maxime Peim Date: Fri, 26 May 2023 07:52:35 +0000 Subject: misc: fix tracedump API In some cases, in the trace dump v2 dump function, we iterate over the client cache even though this one could be empty. Type: fix Change-Id: Ice5cefa25bb93dabe86fe565347cdc32faa674ac Signed-off-by: Maxime Peim --- src/plugins/tracedump/tracedump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/tracedump') diff --git a/src/plugins/tracedump/tracedump.c b/src/plugins/tracedump/tracedump.c index 0c0f3b493b3..10107ac799e 100644 --- a/src/plugins/tracedump/tracedump.c +++ b/src/plugins/tracedump/tracedump.c @@ -420,7 +420,8 @@ vl_api_trace_v2_dump_t_handler (vl_api_trace_v2_dump_t *mp) /* Save the cache, one way or the other */ tdmp->traces[client_index] = client_trace_cache; - for (i = first_thread_id; i <= last_thread_id; i++) + for (i = first_thread_id; + i <= last_thread_id && i < vec_len (client_trace_cache); i++) { // dump a number of 'max' packets per thead for (j = first_position; -- cgit 1.2.3-korg