Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39de68cb authored by Yifan Hong's avatar Yifan Hong
Browse files

libsnapshot: fix null pointer deref

Bug: 148129196
Test: TH
Change-Id: If6a628fe1bcb3006c7a21021162488a807a7f9f7
parent 929c9e8b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1218,7 +1218,8 @@ bool SnapshotManager::RemoveAllSnapshots(LockedFile* lock) {
        if (!UnmapPartitionWithSnapshot(lock, name) || !DeleteSnapshot(lock, name)) {
            // Remember whether or not we were able to unmap the cow image.
            auto cow_image_device = GetCowImageDeviceName(name);
            has_mapped_cow_images |= images_->IsImageMapped(cow_image_device);
            has_mapped_cow_images |=
                    (EnsureImageManager() && images_->IsImageMapped(cow_image_device));

            ok = false;
        }