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

Commit 0a03a5a8 authored by David Anderson's avatar David Anderson
Browse files

snapuserd: Fix infinite loop when reading ops.

Bug: 168554689
Test: vts_libsnapshot_test
Change-Id: I48e62f258ef2b4c368e8237a132c802a03d7020b
parent a2b5d997
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -379,7 +379,11 @@ int Snapuserd::ReadMetadata() {
        struct disk_exception* de =
                reinterpret_cast<struct disk_exception*>((char*)de_ptr.get() + offset);

        if (cow_op->type == kCowFooterOp || cow_op->type == kCowLabelOp) continue;
        if (cow_op->type == kCowFooterOp || cow_op->type == kCowLabelOp) {
            cowop_iter_->Next();
            continue;
        }

        if (!(cow_op->type == kCowReplaceOp || cow_op->type == kCowZeroOp ||
              cow_op->type == kCowCopyOp)) {
            LOG(ERROR) << "Unknown operation-type found: " << cow_op->type;