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

Commit 40cd6376 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Installd: Fix math overflow on quota calculation" into oc-mr1-dev

parents 95d6ca5d bcb8747b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -320,7 +320,8 @@ static int prepare_app_quota(const std::unique_ptr<std::string>& uuid, const std
        }

        dq.dqb_valid = QIF_LIMITS;
        dq.dqb_bhardlimit = (((stat.f_blocks * stat.f_frsize) / 10) * 9) / QIF_DQBLKSIZE;
        dq.dqb_bhardlimit =
            (((static_cast<uint64_t>(stat.f_blocks) * stat.f_frsize) / 10) * 9) / QIF_DQBLKSIZE;
        dq.dqb_ihardlimit = (stat.f_files / 2);
        if (quotactl(QCMD(Q_SETQUOTA, USRQUOTA), device.c_str(), uid,
                reinterpret_cast<char*>(&dq)) != 0) {