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

Commit bc1a5b13 authored by Kelvin Zhang's avatar Kelvin Zhang
Browse files

Fix nullptr access when cow reader open fails

Bug: 260805150
Test: th
Change-Id: Id945cc4fa0fce141e3d52b8259241e22ba590ebd
parent ccf13942
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -93,6 +93,9 @@ bool CompressedSnapshotWriter::VerifyMergeOps() const noexcept {

std::unique_ptr<FileDescriptor> CompressedSnapshotWriter::OpenReader() {
    auto cow = OpenCowReader();
    if (cow == nullptr) {
        return nullptr;
    }

    auto reader = std::make_unique<CompressedSnapshotReader>();
    if (!reader->SetCow(std::move(cow))) {