In the decode function for chunk_refs_by_hash_t, initialize the variable
'hash' of type ceph_le32 to zero before its first use.
This prevents the variable from containing dirty (uninitialized) values,
which could lead to unexpected behavior later in the code.
Fixes: https://tracker.ceph.com/issues/64854
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
(cherry picked from commit
cffcec35c5760ab9142dca06182d42900e247a3c)
int hash_bytes = (hash_bits + 7) / 8;
while (n--) {
int64_t poolid;
- ceph_le32 hash;
+ ceph_le32 hash{0};
uint64_t count;
denc_signed_varint(poolid, p);
memcpy(&hash, p.get_pos_add(hash_bytes), hash_bytes);