lisp: fix cli locator-set name null termination 79/28079/4
authorFlorin Coras <fcoras@cisco.com>
Mon, 27 Jul 2020 21:42:10 +0000 (14:42 -0700)
committerDave Barach <openvpp@barachs.net>
Tue, 28 Jul 2020 12:17:04 +0000 (12:17 +0000)
Type: fix

Change-Id: I5f550bd6a03f47b829ef99803cb6b9ac86329450
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/lisp-cp/control.c
src/vnet/lisp-cp/lisp_cli.c

index 4dc6836..cc3963d 100644 (file)
@@ -2083,14 +2083,9 @@ vnet_lisp_add_del_locator_set (vnet_lisp_add_del_locator_set_args_t * a,
              ls->name = vec_dup (a->name);
 
              if (!lcm->locator_set_index_by_name)
-               lcm->locator_set_index_by_name = hash_create_vec (
-                                                                  /* size */
-                                                                  0,
-                                                                  sizeof
-                                                                  (ls->name
-                                                                   [0]),
-                                                                  sizeof
-                                                                  (uword));
+               lcm->locator_set_index_by_name =
+                 hash_create_vec ( /* size */ 0, sizeof (ls->name[0]),
+                                  sizeof (uword));
              hash_set_mem (lcm->locator_set_index_by_name, ls->name,
                            ls_index);
 
index 31b2ca8..817fb50 100644 (file)
@@ -1179,6 +1179,7 @@ lisp_add_del_locator_set_command_fn (vlib_main_t * vm,
        }
     }
 
+  vec_terminate_c_string (locator_set_name);
   a->name = locator_set_name;
   a->locators = locators;
   a->is_add = is_add;