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

Commit fcf73c08 authored by Devin Moore's avatar Devin Moore
Browse files

RecordedTransaction use Parcel::dataBufferSize

instead of dataSize(). In RecordedTransaction we are recording a parcel
that isn't going to have its data buffer change sizes.

Test: android.hardware.confirmationui-service.trusty_fuzzer
Bug: 276708037

Change-Id: I83b99ef566f388078b10241e9791b1f3410dcf0e
parent 8521bfe7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -131,12 +131,12 @@ std::optional<RecordedTransaction> RecordedTransaction::fromDetails(
        return std::nullopt;
    }

    if (t.mSent.setData(dataParcel.data(), dataParcel.dataSize()) != android::NO_ERROR) {
    if (t.mSent.setData(dataParcel.data(), dataParcel.dataBufferSize()) != android::NO_ERROR) {
        LOG(ERROR) << "Failed to set sent parcel data.";
        return std::nullopt;
    }

    if (t.mReply.setData(replyParcel.data(), replyParcel.dataSize()) != android::NO_ERROR) {
    if (t.mReply.setData(replyParcel.data(), replyParcel.dataBufferSize()) != android::NO_ERROR) {
        LOG(ERROR) << "Failed to set reply parcel data.";
        return std::nullopt;
    }
@@ -349,11 +349,11 @@ android::status_t RecordedTransaction::dumpToFile(const unique_fd& fd) const {
        return UNKNOWN_ERROR;
    }

    if (NO_ERROR != writeChunk(fd, DATA_PARCEL_CHUNK, mSent.dataSize(), mSent.data())) {
    if (NO_ERROR != writeChunk(fd, DATA_PARCEL_CHUNK, mSent.dataBufferSize(), mSent.data())) {
        LOG(ERROR) << "Failed to write sent Parcel to fd " << fd.get();
        return UNKNOWN_ERROR;
    }
    if (NO_ERROR != writeChunk(fd, REPLY_PARCEL_CHUNK, mReply.dataSize(), mReply.data())) {
    if (NO_ERROR != writeChunk(fd, REPLY_PARCEL_CHUNK, mReply.dataBufferSize(), mReply.data())) {
        LOG(ERROR) << "Failed to write reply Parcel to fd " << fd.get();
        return UNKNOWN_ERROR;
    }