From cb3dd14c77f4a44c204b7ac10898ecc33afeb9a0 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Sat, 2 Oct 2021 18:24:31 +0200 Subject: [PATCH] test/latency: fix loop boundary Caught running ASAN. lat_stats_strings[] is an array containing NUM_STATS strings. Fixes: 1e3676a06e4c ("test/latency: add unit tests for latencystats library") Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Reshma Pattan --- app/test/test_latencystats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/test_latencystats.c b/app/test/test_latencystats.c index 427339904d..724acbc315 100644 --- a/app/test/test_latencystats.c +++ b/app/test/test_latencystats.c @@ -80,7 +80,7 @@ static int test_latencystats_get_names(void) /* Success Test: Valid names and size */ size = NUM_STATS; ret = rte_latencystats_get_names(names, size); - for (i = 0; i <= NUM_STATS; i++) { + for (i = 0; i < NUM_STATS; i++) { if (strcmp(lat_stats_strings[i].name, names[i].name) == 0) printf(" %s\n", names[i].name); else -- 2.20.1