From: Danny Al-Gaaf Date: Fri, 13 Mar 2015 20:58:24 +0000 (+0100) Subject: shec/shec.cc: fix uninitialized scalar variable (UNINIT) X-Git-Tag: v9.0.0~95^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0b40e59b636cd6e5ef5ca0fe8c37ad3c9cb7ef99;p=ceph.git shec/shec.cc: fix uninitialized scalar variable (UNINIT) 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 --- diff --git a/src/erasure-code/shec/shec.cc b/src/erasure-code/shec/shec.cc index 178b7652b036..18528a1dd476 100644 --- a/src/erasure-code/shec/shec.cc +++ b/src/erasure-code/shec/shec.cc @@ -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 */