From 8ad3957d762e5c0d0b83f0b4307cae65607bc50e Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Thu, 27 Aug 2020 08:09:14 -0700 Subject: [PATCH] libsnapshot: Fix uninitialized variables We fix two separate instances of classes not initializing members in their constructors. Test: TreeHugger Change-Id: If1b7a7625572c9b005f9b8331b282ed11ceb6e97 --- fs_mgr/libsnapshot/make_cow_from_ab_ota.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs_mgr/libsnapshot/make_cow_from_ab_ota.cpp b/fs_mgr/libsnapshot/make_cow_from_ab_ota.cpp index 0b40fd60b..d0b8f52e0 100644 --- a/fs_mgr/libsnapshot/make_cow_from_ab_ota.cpp +++ b/fs_mgr/libsnapshot/make_cow_from_ab_ota.cpp @@ -252,7 +252,7 @@ static uint64_t SizeOfAllExtents(const T& extents) { class PuffInputStream final : public puffin::StreamInterface { public: - PuffInputStream(uint8_t* buffer, size_t length) : buffer_(buffer), length_(length) {} + PuffInputStream(uint8_t* buffer, size_t length) : buffer_(buffer), length_(length), pos_(0) {} bool GetSize(uint64_t* size) const override { *size = length_; @@ -472,7 +472,7 @@ template class ExtentIter final { public: ExtentIter(const ContainerType& container) - : iter_(container.cbegin()), end_(container.cend()) {} + : iter_(container.cbegin()), end_(container.cend()), dst_index_(0) {} bool GetNext(uint64_t* block) { while (iter_ != end_) {