diff options
author | Dave Barach <dave@barachs.net> | 2018-10-17 10:38:51 -0400 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-10-23 13:06:46 +0000 |
commit | b7b929931a07fbb27b43d5cd105f366c3e29807e (patch) | |
tree | 438681c89738802dbb5d339715b96ea2c31bafb4 /src/vpp-api/vapi/vapi.c | |
parent | b9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff) |
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vpp-api/vapi/vapi.c')
-rw-r--r-- | src/vpp-api/vapi/vapi.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/vpp-api/vapi/vapi.c b/src/vpp-api/vapi/vapi.c index 70382d17bbb..031c421d355 100644 --- a/src/vpp-api/vapi/vapi.c +++ b/src/vpp-api/vapi/vapi.c @@ -262,8 +262,9 @@ vapi_ctx_alloc (vapi_ctx_t * result) { goto fail; } - memset (ctx->vapi_msg_id_t_to_vl_msg_id, ~0, - __vapi_metadata.count * sizeof (*ctx->vapi_msg_id_t_to_vl_msg_id)); + clib_memset (ctx->vapi_msg_id_t_to_vl_msg_id, ~0, + __vapi_metadata.count * + sizeof (*ctx->vapi_msg_id_t_to_vl_msg_id)); ctx->event_cbs = calloc (__vapi_metadata.count, sizeof (*ctx->event_cbs)); if (!ctx->event_cbs) { @@ -318,7 +319,7 @@ vapi_connect (vapi_ctx_t ctx, const char *name, return VAPI_ENOMEM; } ctx->requests = tmp; - memset (ctx->requests, 0, size); + clib_memset (ctx->requests, 0, size); /* coverity[MISSING_LOCK] - 177211 requests_mutex is not needed here */ ctx->requests_start = ctx->requests_count = 0; if (chroot_prefix) @@ -651,8 +652,8 @@ vapi_dispatch_response (vapi_ctx_t ctx, vapi_msg_id_t id, requests_start].callback_ctx, VAPI_ENORESP, true, NULL); - memset (&ctx->requests[ctx->requests_start], 0, - sizeof (ctx->requests[ctx->requests_start])); + clib_memset (&ctx->requests[ctx->requests_start], 0, + sizeof (ctx->requests[ctx->requests_start])); ++ctx->requests_start; --ctx->requests_count; if (ctx->requests_start == ctx->requests_size) @@ -693,8 +694,8 @@ vapi_dispatch_response (vapi_ctx_t ctx, vapi_msg_id_t id, } if (is_last) { - memset (&ctx->requests[ctx->requests_start], 0, - sizeof (ctx->requests[ctx->requests_start])); + clib_memset (&ctx->requests[ctx->requests_start], 0, + sizeof (ctx->requests[ctx->requests_start])); ++ctx->requests_start; --ctx->requests_count; if (ctx->requests_start == ctx->requests_size) |