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

Commit d4806c63 authored by Tom Cherry's avatar Tom Cherry Committed by Automerger Merge Worker
Browse files

fsmgr: fix integer overflow in fs_mgr am: e28dc48d

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11882481

Change-Id: Iade7ea2ae1b606af1418053b68b00e3d25fcd155
parents 9f5f5fee e28dc48d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -331,7 +331,7 @@ static bool read_ext4_superblock(const std::string& blk_device, const FstabEntry
            // try backup superblock, if main superblock is corrupted
            for (unsigned int blocksize = EXT4_MIN_BLOCK_SIZE; blocksize <= EXT4_MAX_BLOCK_SIZE;
                 blocksize *= 2) {
                unsigned int superblock = blocksize * 8;
                uint64_t superblock = blocksize * 8;
                if (blocksize == EXT4_MIN_BLOCK_SIZE) superblock++;

                if (TEMP_FAILURE_RETRY(pread(fd, sb, sizeof(*sb), superblock * blocksize)) !=