diff --git a/libfreerdp/core/gateway/rpc_client.c b/libfreerdp/core/gateway/rpc_client.c index eaff47d7b..1d8e45955 100644 --- a/libfreerdp/core/gateway/rpc_client.c +++ b/libfreerdp/core/gateway/rpc_client.c @@ -425,7 +425,7 @@ int rpc_client_recv_fragment(rdpRpc* rpc, wStream* fragment) pdu->Flags = 0; pdu->Type = header->common.ptype; pdu->CallId = header->common.call_id; - if (Stream_EnsureCapacity(pdu->s, Stream_Length(fragment))) + if (!Stream_EnsureCapacity(pdu->s, Stream_Length(fragment))) return -1; Stream_Write(pdu->s, buffer, Stream_Length(fragment)); Stream_SealLength(pdu->s);