l2: fix l2input_feat_names overflow 43/28243/2
authorBenoît Ganne <bganne@cisco.com>
Mon, 16 Dec 2019 14:51:38 +0000 (15:51 +0100)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Wed, 12 Aug 2020 07:43:14 +0000 (07:43 +0000)
Type: fix

Change-Id: I59549b3aab5a0ccfe7db02757f78528e028121a5
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 70ef0faea9f706004c068fb843797a7cb08a9e68)

src/vnet/l2/l2_input.c

index 4efb556..7b93fba 100644 (file)
@@ -83,7 +83,7 @@ format_l2_input_features (u8 * s, va_list * args)
 
   feature_bitmap &= ~L2INPUT_FEAT_DROP;        /* Not a feature */
   int i;
-  for (i = L2INPUT_N_FEAT; i >= 0; i--)
+  for (i = L2INPUT_N_FEAT - 1; i >= 0; i--)
     {
       if (feature_bitmap & (1 << i))
        {