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

Commit 403887b7 authored by Steven Moreland's avatar Steven Moreland Committed by Android (Google) Code Review
Browse files

Merge "RPC Binder: detect bad transaction args early" into main

parents 75425078 77db654a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -568,6 +568,11 @@ status_t RpcState::transactAddress(const sp<RpcSession::RpcConnection>& connecti
    LOG_ALWAYS_FATAL_IF(!data.isForRpc());
    LOG_ALWAYS_FATAL_IF(data.objectsCount() != 0);

    if (!(flags & IBinder::FLAG_ONEWAY)) {
        LOG_ALWAYS_FATAL_IF(reply == nullptr,
                            "Reply parcel must be used for synchronous transaction.");
    }

    uint64_t asyncNumber = 0;

    if (address != 0) {
@@ -659,8 +664,6 @@ status_t RpcState::transactAddress(const sp<RpcSession::RpcConnection>& connecti
        return OK;
    }

    LOG_ALWAYS_FATAL_IF(reply == nullptr, "Reply parcel must be used for synchronous transaction.");

    return waitForReply(connection, session, reply);
}