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

Commit 77db654a authored by Steven Moreland's avatar Steven Moreland
Browse files

RPC Binder: detect bad transaction args early

Bug: 416772676
Test: binderRpcTest
Change-Id: Ia83f7ace5535d032f283805607ae0bd37d7ea05d
parent 3e451bf9
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);
}