summaryrefslogtreecommitdiffstats
path: root/src/plugins/tracedump/tracedump.c
diff options
context:
space:
mode:
authorMaxime Peim <mpeim@cisco.com>2023-05-26 07:52:35 +0000
committerBeno�t Ganne <bganne@cisco.com>2023-05-30 09:16:22 +0000
commit94a0f57a62856c3bf3e427f6694a5a40f57f8d4d (patch)
tree5608b56d84f3c79041561fc69df6f8ddab8c7884 /src/plugins/tracedump/tracedump.c
parent562ac2f4e4f55b6337570567eaf8f3f0def62d3f (diff)
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 <mpeim@cisco.com>
Diffstat (limited to 'src/plugins/tracedump/tracedump.c')
-rw-r--r--src/plugins/tracedump/tracedump.c3
1 files changed, 2 insertions, 1 deletions
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;