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

Commit e33af7fe authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Jeff Sharkey
Browse files

Force-initialize potential padding area.

When collapsing our heap-and-stack boundaries, we round up to ensure
our padding math is still aligned on the remote side.  This rounding
can leak a small amount of uninitialized memory, so this change
force-initializes any potential padding area.

Bug: 213170822
Test: atest libandroidfw_tests
Change-Id: Ife6fcd1b74aaabd932a77ea42e0d0ad3a6b9cae6
parent c894c810
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -227,6 +227,7 @@ status_t CursorWindow::writeToParcel(Parcel* parcel) {
        if (!dest) goto fail;
        memcpy(static_cast<uint8_t*>(dest),
                static_cast<uint8_t*>(mData), mAllocOffset);
        memset(static_cast<uint8_t*>(dest) + mAllocOffset, 0, 4);
        memcpy(static_cast<uint8_t*>(dest) + compactedSize - slotsSize,
                static_cast<uint8_t*>(mData) + mSlotsOffset, slotsSize);
    }