summaryrefslogtreecommitdiffstats
path: root/src/erasure-code/shec
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2015-03-13 19:19:20 +0100
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2015-03-17 09:19:40 +0100
commitf526ddebfb10e755ef8599746de2bb56e738df34 (patch)
tree299f57dc627fc571f29423314b39a70b271e59ee /src/erasure-code/shec
parentutime.h: fix OVERFLOW_BEFORE_WIDEN (diff)
downloadceph-f526ddebfb10e755ef8599746de2bb56e738df34.tar.xz
ceph-f526ddebfb10e755ef8599746de2bb56e738df34.zip
ErasureCodeShec.cc: fix uninitialized scalar variable (UNINIT)
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>
Diffstat (limited to 'src/erasure-code/shec')
-rw-r--r--src/erasure-code/shec/ErasureCodeShec.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/erasure-code/shec/ErasureCodeShec.cc b/src/erasure-code/shec/ErasureCodeShec.cc
index 6f2c1945329..b1dfd84e022 100644
--- a/src/erasure-code/shec/ErasureCodeShec.cc
+++ b/src/erasure-code/shec/ErasureCodeShec.cc
@@ -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()) {