From: Andrew Yourtchenko <ayourtch@gmail.com>
Date: Tue, 23 Aug 2022 16:54:53 +0000 (+0000)
Subject: nsh: fix coverity 249201
X-Git-Tag: v23.02-rc0~69
X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=c8d1c8cfb80f1cf0d6dc128e9beea3fcb5c3d741;p=vpp.git

nsh: fix coverity 249201

Zero-initialize the temporary struct, else a->map.adj_index is being used unset.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: Ia02636ea1e911250d6aa5e413de48e1e09863880
---

diff --git a/src/plugins/nsh/nsh_api.c b/src/plugins/nsh/nsh_api.c
index 670a4ee0b03..da6650dac7c 100644
--- a/src/plugins/nsh/nsh_api.c
+++ b/src/plugins/nsh/nsh_api.c
@@ -169,7 +169,7 @@ vl_api_nsh_add_del_map_t_handler (vl_api_nsh_add_del_map_t * mp)
 {
   vl_api_nsh_add_del_map_reply_t *rmp;
   int rv;
-  nsh_add_del_map_args_t _a, *a = &_a;
+  nsh_add_del_map_args_t _a = { 0 }, *a = &_a;
   u32 map_index = ~0;
 
   a->is_add = mp->is_add;