summaryrefslogtreecommitdiffstats
path: root/src/vnet/lisp-cp/lisp_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/lisp-cp/lisp_api.c')
-rw-r--r--src/vnet/lisp-cp/lisp_api.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vnet/lisp-cp/lisp_api.c b/src/vnet/lisp-cp/lisp_api.c
index cb2eb0d9171..58235d046c8 100644
--- a/src/vnet/lisp-cp/lisp_api.c
+++ b/src/vnet/lisp-cp/lisp_api.c
@@ -128,7 +128,7 @@ vl_api_lisp_add_del_locator_set_t_handler (vl_api_lisp_add_del_locator_set_t *
memset (a, 0, sizeof (a[0]));
- mp->locator_set_name[63] = 0;
+ mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
locator_name = format (0, "%s", mp->locator_set_name);
vec_terminate_c_string (locator_name);
@@ -184,7 +184,7 @@ vl_api_lisp_add_del_locator_t_handler (vl_api_lisp_add_del_locator_t * mp)
locator.local = 1;
vec_add1 (locators, locator);
- mp->locator_set_name[63] = 0;
+ mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
locator_name = format (0, "%s", mp->locator_set_name);
vec_terminate_c_string (locator_name);
@@ -252,7 +252,7 @@ vl_api_lisp_add_del_local_eid_t_handler (vl_api_lisp_add_del_local_eid_t * mp)
if (rv)
goto out;
- mp->locator_set_name[63] = 0;
+ mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
name = format (0, "%s", mp->locator_set_name);
vec_terminate_c_string (name);
p = hash_get_mem (lcm->locator_set_index_by_name, name);
@@ -395,6 +395,7 @@ vl_api_lisp_pitr_set_locator_set_t_handler (vl_api_lisp_pitr_set_locator_set_t
int rv = 0;
u8 *ls_name = 0;
+ mp->ls_name[sizeof (mp->ls_name) - 1] = 0;
ls_name = format (0, "%s", mp->ls_name);
vec_terminate_c_string (ls_name);
rv = vnet_lisp_pitr_set_locator_set (ls_name, mp->is_add);
@@ -483,7 +484,7 @@ static void
u8 *locator_set_name = NULL;
vnet_lisp_add_del_mreq_itr_rloc_args_t _a, *a = &_a;
- mp->locator_set_name[63] = 0;
+ mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
locator_set_name = format (0, "%s", mp->locator_set_name);
vec_terminate_c_string (locator_set_name);