diff options
author | Vratko Polak <vrpolak@cisco.com> | 2019-07-02 11:07:24 +0200 |
---|---|---|
committer | Vratko Polak <vrpolak@cisco.com> | 2019-07-03 17:44:38 +0000 |
commit | fc4828cdbed3f8d6cef8d02239f8603d789ac099 (patch) | |
tree | 7c9e510305fa6438a90cd9e8b7a64572c16fa809 /src/vlibmemory/memory_shared.h | |
parent | 0c7f54d489c66742903c460daa843ce048dbaf06 (diff) |
api: remove garbage from sockclnt_create reply
The fix uses memset to zero after alloc,
as sizing of source string is not obvious.
Function vl_msg_api_alloc_zero is added (and used),
so similar bugs can be fixed easily.
Type: fix
Ticket: VPP-1716
Change-Id: I3b20040d0de4222686c58779f2c0af78c5543504
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'src/vlibmemory/memory_shared.h')
-rw-r--r-- | src/vlibmemory/memory_shared.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vlibmemory/memory_shared.h b/src/vlibmemory/memory_shared.h index 662eaf96589..8d5e472e455 100644 --- a/src/vlibmemory/memory_shared.h +++ b/src/vlibmemory/memory_shared.h @@ -109,8 +109,10 @@ typedef struct vl_shmem_hdr_ #define VL_API_EPOCH_SHIFT 8 void *vl_msg_api_alloc (int nbytes); +void *vl_msg_api_alloc_zero (int nbytes); void *vl_msg_api_alloc_or_null (int nbytes); void *vl_msg_api_alloc_as_if_client (int nbytes); +void *vl_msg_api_alloc_zero_as_if_client (int nbytes); void *vl_msg_api_alloc_as_if_client_or_null (int nbytes); void *vl_mem_api_alloc_as_if_client_w_reg (vl_api_registration_t * reg, int nbytes); |