svm: fix coverity 249207,249209 26/36926/3
authorAndrew Yourtchenko <ayourtch@gmail.com>
Wed, 17 Aug 2022 13:44:16 +0000 (13:44 +0000)
committerMatthew Smith <mgsmith@netgate.com>
Wed, 17 Aug 2022 15:47:23 +0000 (15:47 +0000)
Zero-initialize the temporary struct.

Type: fix
Change-Id: I6f7a35ace6002aa75dc986c7c7eca614c9c5c3ed
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
src/svm/svmdb.c

index 7628c0a..531ea1f 100644 (file)
@@ -433,7 +433,7 @@ svmdb_local_serialize_strings (svmdb_client_t * client, char *filename)
   u8 *key;
   u32 value;
   svmdb_shm_hdr_t *shm = client->shm;
-  serialize_main_t _sm, *sm = &_sm;
+  serialize_main_t _sm = { 0 }, *sm = &_sm;
   clib_error_t *error = 0;
   u8 *sanitized_name = 0;
   int fd = 0;
@@ -495,7 +495,7 @@ out:
 int
 svmdb_local_unserialize_strings (svmdb_client_t * client, char *filename)
 {
-  serialize_main_t _sm, *sm = &_sm;
+  serialize_main_t _sm = { 0 }, *sm = &_sm;
   void *oldheap;
   clib_error_t *error = 0;
   u8 *key, *value;