fib: fix coverity 249175 05/37005/2
authorAndrew Yourtchenko <ayourtch@gmail.com>
Tue, 23 Aug 2022 17:29:00 +0000 (17:29 +0000)
committerNeale Ranns <neale@graphiant.com>
Mon, 29 Aug 2022 23:52:39 +0000 (23:52 +0000)
Add an assert to express the constraint to coverity without
incurring the overhead in release builds.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I2c22f8b2565c645d95c9c0be37381060e151420f

src/vnet/fib/fib_entry_src.c

index c0275e8..39e719e 100644 (file)
@@ -46,6 +46,7 @@ fib_entry_src_get_vft (const fib_entry_src_t *esrc)
         return (&fib_entry_src_bh_vft[FIB_SOURCE_BH_INTERPOSE]);
     }
 
+    ASSERT(bh < FIB_SOURCE_BH_MAX);
     return (&fib_entry_src_bh_vft[bh]);
 }