aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-04-04 18:34:41 -0400
committerDave Barach <dave@barachs.net>2020-04-04 18:37:01 -0400
commit0250090fc0c24214cb1fa969f6e2f585099ee36b (patch)
tree7fd794527aea622f109613d168fc8fc418589eb0 /src/vpp
parent9f86d225ab4f3dccbf61383a75d6af7d321a204e (diff)
misc: strcpy be gone
Causes static analysis "vulnerability" warnings Type: fix Ticket: VPP-1837 Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I272fa69251d70f62178e6dff0423c16f99937af1
Diffstat (limited to 'src/vpp')
-rw-r--r--src/vpp/api/json_format.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vpp/api/json_format.h b/src/vpp/api/json_format.h
index 154fb3df04b..63217979ccd 100644
--- a/src/vpp/api/json_format.h
+++ b/src/vpp/api/json_format.h
@@ -94,7 +94,7 @@ vat_json_set_string_copy (vat_json_node_t * json, const u8 * str)
{
u8 *ns = NULL;
vec_validate (ns, strlen ((const char *) str));
- strcpy ((char *) ns, (const char *) str);
+ strncpy ((char *) ns, (const char *) str, vec_len (ns));
vec_add1 (ns, '\0');
vat_json_set_string (json, ns);
}