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

Commit 7b8d3e8d authored by Yifan Hong's avatar Yifan Hong Committed by android-build-merger
Browse files

Merge "liblp: SparseBuilder: num_blocks aren't check correctly" am: af4a0e84

am: a6f70fb0

Change-Id: Ie15826f0e68012842fe59aebd92df2c61cf47b1a
parents 1142eae0 a6f70fb0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ SparseBuilder::SparseBuilder(const LpMetadata& metadata, uint32_t block_size,
        return;
    }

    uint64_t num_blocks = total_size % block_size;
    uint64_t num_blocks = total_size / block_size;
    if (num_blocks >= UINT_MAX) {
        // libsparse counts blocks in unsigned 32-bit integers, so we check to
        // make sure we're not going to overflow.