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

Commit 208d0872 authored by Chad Brubaker's avatar Chad Brubaker
Browse files

Whitelist updatePCR from fsanitize=integer

updatePCR does some math to compute transport rate for logging that can
cause an unsigned overflow. Since this is harmless and only for logging
whitelist the function as its otherwise safe from integer issues.

Bug:23110888

Change-Id: I0686afeef99ccf636701d687e5628ae057f60e4c
(cherry picked from commit c9fa35cf)
parent f3ff858f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1319,6 +1319,7 @@ bool ATSParser::PTSTimeDeltaEstablished() {
    return mPrograms.editItemAt(0)->PTSTimeDeltaEstablished();
}

__attribute__((no_sanitize("integer")))
void ATSParser::updatePCR(
        unsigned /* PID */, uint64_t PCR, size_t byteOffsetFromStart) {
    ALOGV("PCR 0x%016" PRIx64 " @ %zu", PCR, byteOffsetFromStart);
@@ -1337,6 +1338,7 @@ void ATSParser::updatePCR(
    ++mNumPCRs;

    if (mNumPCRs == 2) {
        /* Unsigned overflow here */
        double transportRate =
            (mPCRBytes[1] - mPCRBytes[0]) * 27E6 / (mPCR[1] - mPCR[0]);