From 2e5d4fbe0683c320eb7db714a3ca8275560c20c4 Mon Sep 17 00:00:00 2001 From: Martin Fleisz Date: Wed, 14 Feb 2024 15:34:44 +0100 Subject: [PATCH] gateway: Do not fail if unprocessed padding bytes are detected Sometimes the RPC PDUs have unprocessed data (padding bytes) at their end. In that case do not fail but just log a warning with the correct amount of remaining bytes. --- libfreerdp/core/gateway/rpc_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libfreerdp/core/gateway/rpc_client.c b/libfreerdp/core/gateway/rpc_client.c index 3a3f0ce44..319043fde 100644 --- a/libfreerdp/core/gateway/rpc_client.c +++ b/libfreerdp/core/gateway/rpc_client.c @@ -348,8 +348,8 @@ static int rpc_client_recv_pdu(rdpRpc* rpc, RPC_PDU* pdu) const size_t after = Stream_GetRemainingLength(pdu->s); if (after > 0) { - WLog_ERR(TAG, "incompletely parsed RPC PDU, %" PRIuz " byte remain", before); - return -1; + /* Just log so we do not fail if we have some unprocessed padding bytes */ + WLog_WARN(TAG, "Incompletely parsed RPC PDU (%" PRIuz " bytes remain)", after); } return rc;