From fc9a48f5cbcebb1587abbe8377960d82f0717e82 Mon Sep 17 00:00:00 2001 From: Akilesh Kailash Date: Thu, 19 May 2022 19:35:27 +0000 Subject: [PATCH] libsnapshot: Initialize merge_op_start_ to zero. merge_op_start_ is used to set the iterator for merge operations. Uninitialized value can potentially lead to setting up of bad iterator. Bug: 233246309 Test: Full OTA Signed-off-by: Akilesh Kailash Change-Id: I3cc48a66b532cfe8b2d87c8724d77ab3169a2ddb --- fs_mgr/libsnapshot/include/libsnapshot/cow_reader.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs_mgr/libsnapshot/include/libsnapshot/cow_reader.h b/fs_mgr/libsnapshot/include/libsnapshot/cow_reader.h index 8e6bbd9b6..f4d5c72f3 100644 --- a/fs_mgr/libsnapshot/include/libsnapshot/cow_reader.h +++ b/fs_mgr/libsnapshot/include/libsnapshot/cow_reader.h @@ -171,11 +171,11 @@ class CowReader final : public ICowReader { std::optional last_label_; std::shared_ptr> ops_; std::shared_ptr> merge_op_blocks_; - uint64_t merge_op_start_; + uint64_t merge_op_start_{}; std::shared_ptr> block_map_; - uint64_t num_total_data_ops_; - uint64_t num_ordered_ops_to_merge_; - bool has_seq_ops_; + uint64_t num_total_data_ops_{}; + uint64_t num_ordered_ops_to_merge_{}; + bool has_seq_ops_{}; std::shared_ptr> data_loc_; ReaderFlags reader_flag_; };