classify: fix coverity 249223 42/36942/2
authorAndrew Yourtchenko <ayourtch@gmail.com>
Thu, 18 Aug 2022 12:38:00 +0000 (12:38 +0000)
committerBeno�t Ganne <bganne@cisco.com>
Tue, 23 Aug 2022 15:09:54 +0000 (15:09 +0000)
Day1 latent integer overflow.

vnet_classify_add_del defines new_hash as u32 - so replace a u64 type with u32
in split_and_rehash as well.

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

src/vnet/classify/vnet_classify.c

index 8281be5..305521b 100644 (file)
@@ -293,7 +293,7 @@ split_and_rehash (vnet_classify_table_t * t,
 
   for (i = 0; i < length_in_entries; i++)
     {
-      u64 new_hash;
+      u32 new_hash;
 
       v = vnet_classify_entry_at_index (t, old_values, i);