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>
This commit is contained in:
Maxime Peim
2023-05-26 07:52:35 +00:00
committed by Beno�t Ganne
parent 562ac2f4e4
commit 94a0f57a62

View File

@ -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;