Loading libs/binder/RpcState.cpp +11 −1 Original line number Diff line number Diff line Loading @@ -656,7 +656,13 @@ status_t RpcState::waitForReply(const sp<RpcSession::RpcConnection>& connection, memset(&rpcReply, 0, sizeof(RpcWireReply)); // zero because of potential short read CommandData data(command.bodySize - rpcReplyWireSize); if (!data.valid()) return NO_MEMORY; if (!data.valid()) { // b/404210068 - if we run out of memory, the wire protocol gets messed up. // so shutdown. We would need to read all the transaction data anyway and // send a reply still to gracefully recover. (void)session->shutdownAndWait(false); return NO_MEMORY; } iovec iovs[]{ {&rpcReply, rpcReplyWireSize}, Loading Loading @@ -813,6 +819,10 @@ status_t RpcState::processTransact( CommandData transactionData(command.bodySize); if (!transactionData.valid()) { // b/404210068 - if we run out of memory, the wire protocol gets messed up. // so shutdown. We would need to read all the transaction data anyway and // send a reply still to gracefully recover. (void)session->shutdownAndWait(false); return NO_MEMORY; } iovec iov{transactionData.data(), transactionData.size()}; Loading Loading
libs/binder/RpcState.cpp +11 −1 Original line number Diff line number Diff line Loading @@ -656,7 +656,13 @@ status_t RpcState::waitForReply(const sp<RpcSession::RpcConnection>& connection, memset(&rpcReply, 0, sizeof(RpcWireReply)); // zero because of potential short read CommandData data(command.bodySize - rpcReplyWireSize); if (!data.valid()) return NO_MEMORY; if (!data.valid()) { // b/404210068 - if we run out of memory, the wire protocol gets messed up. // so shutdown. We would need to read all the transaction data anyway and // send a reply still to gracefully recover. (void)session->shutdownAndWait(false); return NO_MEMORY; } iovec iovs[]{ {&rpcReply, rpcReplyWireSize}, Loading Loading @@ -813,6 +819,10 @@ status_t RpcState::processTransact( CommandData transactionData(command.bodySize); if (!transactionData.valid()) { // b/404210068 - if we run out of memory, the wire protocol gets messed up. // so shutdown. We would need to read all the transaction data anyway and // send a reply still to gracefully recover. (void)session->shutdownAndWait(false); return NO_MEMORY; } iovec iov{transactionData.data(), transactionData.size()}; Loading