aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-07-27 14:42:10 -0700
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-08-18 19:47:21 +0000
commit1cadeaab9813f69d7a9ad149f93dbe9012614624 (patch)
tree4cf6649a7df944f048d255b4daa2dee51b440005
parent554159af58505dd41fc2db2f813a1270452ef746 (diff)
lisp: fix cli locator-set name null termination
Type: fix Change-Id: I5f550bd6a03f47b829ef99803cb6b9ac86329450 Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 39771adc1da61943978c18b58b35dedc9dddc4b0)
-rw-r--r--src/vnet/lisp-cp/control.c11
-rw-r--r--src/vnet/lisp-cp/lisp_cli.c1
2 files changed, 4 insertions, 8 deletions
diff --git a/src/vnet/lisp-cp/control.c b/src/vnet/lisp-cp/control.c
index 3cb5f1335a8..6f26d1e2aeb 100644
--- a/src/vnet/lisp-cp/control.c
+++ b/src/vnet/lisp-cp/control.c
@@ -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);
diff --git a/src/vnet/lisp-cp/lisp_cli.c b/src/vnet/lisp-cp/lisp_cli.c
index 31b2ca88cbf..817fb50156b 100644
--- a/src/vnet/lisp-cp/lisp_cli.c
+++ b/src/vnet/lisp-cp/lisp_cli.c
@@ -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;