]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
shec/shec.cc: fix uninitialized scalar variable (UNINIT)
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 13 Mar 2015 20:58:24 +0000 (21:58 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 17 Mar 2015 08:19:40 +0000 (09:19 +0100)
Fix for:

CID 1274311: Uninitialized scalar variable (UNINIT)
 uninit_use_in_call: Using uninitialized element of array
 dm_ids when calling shec_make_decoding_matrix.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/erasure-code/shec/shec.cc

index 178b7652b036199f92f1d9f0ee8bbb981e9c197b..18528a1dd476ee857ec8b25b8109d57b834e7f78 100644 (file)
@@ -284,6 +284,8 @@ int shec_matrix_decode(int k, int m, int w, int *matrix,
   int *decoding_matrix = NULL, dm_ids[k];
   int minimum[k + m];
 
+  memset(dm_ids, 0, sizeof(dm_ids));
+
   if (w != 8 && w != 16 && w != 32) return -1;
 
   /* Find the number of data drives failed */