diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 4b13d84ad1..661c72c7ef 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -12111,7 +12111,7 @@ comp_names_to_index(struct context *ctx, const struct token *token, RTE_SET_USED(token); if (!buf) return names_size; - if (names[ent] && ent < names_size) + if (ent < names_size && names[ent] != NULL) return rte_strscpy(buf, names[ent], size); return -1;