aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-api-test/vat
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2016-09-20 12:37:09 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-09-20 14:34:20 +0000
commitf07fb71b6276429bd81b5ae3669c8f33d38df1fa (patch)
tree3b1bd18320329da15d8759ad3ea3ded28acea659 /vpp-api-test/vat
parent560e809b4459f508b756a19493de746e0892389e (diff)
VPP-189: fix coverity issue in api_format.c
Change-Id: Ib16fd69abe93c1afb2ee1d38144763f57888585c Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'vpp-api-test/vat')
-rw-r--r--vpp-api-test/vat/api_format.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c
index 1fbe9244909..7b5b4341e86 100644
--- a/vpp-api-test/vat/api_format.c
+++ b/vpp-api-test/vat/api_format.c
@@ -12963,6 +12963,12 @@ api_lisp_locator_dump (vat_main_t * vam)
return -99;
}
+ if (vec_len (ls_name) > 63)
+ {
+ errmsg ("error: locator set name too long!");
+ return -99;
+ }
+
if (!vam->json_output)
{
fformat (vam->ofp, "%=16s%=16s%=16s\n", "locator", "priority",
@@ -12977,7 +12983,7 @@ api_lisp_locator_dump (vat_main_t * vam)
else
{
vec_add1 (ls_name, 0);
- strcpy ((char *) mp->ls_name, (char *) ls_name);
+ strncpy ((char *) mp->ls_name, (char *) ls_name, sizeof (mp->ls_name));
}
/* send it... */