]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ErasureCodeShec.cc: fix uninitialized scalar variable (UNINIT)
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 13 Mar 2015 18:19:20 +0000 (19:19 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 17 Mar 2015 08:19:40 +0000 (09:19 +0100)
Fix for:
CID 1274310: Uninitialized scalar variable (UNINIT)
 6. uninit_use_in_call: Using uninitialized element of
 array erased when calling shec_make_decoding_matrix.

CID 1274312: Uninitialized scalar variable (UNINIT)
 24. 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/ErasureCodeShec.cc

index 6f2c194532968f91f5c44b63982c14d3bb2f878e..b1dfd84e022e6de348c84c80ed5420c924bc3903 100644 (file)
@@ -101,6 +101,9 @@ int ErasureCodeShec::minimum_to_decode(const set<int> &want_to_decode,
     int minimum[k + m];
     int dm_ids[k];
 
+    memset(erased, 0, sizeof(erased));
+    memset(dm_ids, 0, sizeof(dm_ids));
+
     for (int i = 0; i < k + m; i++) {
       erased[i] = 0;
       if (available_chunks.find(i) == available_chunks.end()) {