From 5c944eef7012e7c5b363399ed92966fb659196b7 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Tue, 7 Jan 2020 12:29:10 -0500 Subject: [PATCH] vlib: fix coverity warning / real bug The path must be next-to-impossible to hit, because the code has been wrong for at least 5 years. Type: fix Signed-off-by: Dave Barach Change-Id: I23b8c4e1631827e7931f353c561c1e19c596c598 --- src/vlib/cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vlib/cli.c b/src/vlib/cli.c index 467d1f7b906..bb6c5746537 100644 --- a/src/vlib/cli.c +++ b/src/vlib/cli.c @@ -1217,7 +1217,7 @@ add_sub_command (vlib_cli_main_t * cm, uword parent_index, uword child_index) vec_len (p->sub_rules)); vec_add2 (p->sub_rules, sr, 1); sr->name = sub_name; - sr->rule_index = q[0]; + sr->rule_index = sr - p->sub_rules; sr->command_index = child_index; return; } -- 2.16.6