From 33c7f6590ad8943762711409307ff4ddf9097c42 Mon Sep 17 00:00:00 2001 From: Emmanuel Ledoux Date: Fri, 19 Oct 2018 11:56:56 +0200 Subject: [PATCH] fixed partial reads --- libfreerdp/core/gateway/rdg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libfreerdp/core/gateway/rdg.c b/libfreerdp/core/gateway/rdg.c index 42fab4153..b1bab4824 100644 --- a/libfreerdp/core/gateway/rdg.c +++ b/libfreerdp/core/gateway/rdg.c @@ -79,10 +79,11 @@ static BOOL rdg_read_all(rdpTls* tls, BYTE* buffer, int size) { int status; int readCount = 0; + BYTE* pBuffer = buffer; while (readCount < size) { - status = BIO_read(tls->bio, buffer, size - readCount); + status = BIO_read(tls->bio, pBuffer, size - readCount); if (status <= 0) { @@ -93,6 +94,7 @@ static BOOL rdg_read_all(rdpTls* tls, BYTE* buffer, int size) } readCount += status; + pBuffer += status; } return TRUE;