From 35418ba491505318e0b08b372fcf1e9f0d45d80f Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Tue, 9 Jun 2020 14:17:45 +0000 Subject: vapi: memset allocated messages to zero This avoids using dirty data from shared memory by client. Type: fix Signed-off-by: Klement Sekera Change-Id: I96eecf655bf344ec29609cedbd8dc891b572e207 --- src/vpp-api/vapi/vapi.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/vpp-api/vapi/vapi.c b/src/vpp-api/vapi/vapi.c index 8a9c8e3b450..ec87e7b7b72 100644 --- a/src/vpp-api/vapi/vapi.c +++ b/src/vpp-api/vapi/vapi.c @@ -221,6 +221,10 @@ vapi_msg_alloc (vapi_ctx_t ctx, size_t size) return NULL; } void *rv = vl_msg_api_alloc_or_null (size); + if (rv) + { + clib_memset (rv, 0, size); + } return rv; } -- cgit 1.2.3-korg