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

Commit 7fb93c16 authored by Woody Chow's avatar Woody Chow
Browse files

Fix unsigned integer overflow of i, which gives SIGABRT

Bug: 147640670
Test: None

Change-Id: I157aacbf9ddaa6a91eccd940573cf187b58e8d5e
parent 0852b10b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1092,7 +1092,9 @@ int fs_mgr_mount_all(Fstab* fstab, int mount_mode) {
        return FS_MGR_MNTALL_FAIL;
    }

    for (size_t i = 0; i < fstab->size(); i++) {
    // Keep i int to prevent unsigned integer overflow from (i = top_idx - 1),
    // where top_idx is 0. It will give SIGABRT
    for (int i = 0; i < static_cast<int>(fstab->size()); i++) {
        auto& current_entry = (*fstab)[i];

        // If a filesystem should have been mounted in the first stage, we