X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp%2Fapi%2Fjson_format.h;h=63217979ccde959b155bcb09073f949f36cf2161;hb=0250090fc0c24214cb1fa969f6e2f585099ee36b;hp=154fb3df04b574436ffaf5688f61ad7057f05418;hpb=9f86d225ab4f3dccbf61383a75d6af7d321a204e;p=vpp.git 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); }