From 7e397d0f1ca693f4c5b8f7de4b0dd978ca86033d Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 18 Oct 2018 16:58:53 +0200 Subject: [PATCH] Fixed http gateway body length read. --- libfreerdp/core/gateway/http.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libfreerdp/core/gateway/http.c b/libfreerdp/core/gateway/http.c index 6920d98..565c878 100644 --- a/libfreerdp/core/gateway/http.c +++ b/libfreerdp/core/gateway/http.c @@ -842,15 +842,15 @@ HttpResponse* http_response_recv(rdpTls* tls) } if (response->BodyLength > 0) - { response->BodyContent = &(Stream_Buffer(response->data))[payloadOffset]; - response->BodyLength = bodyLength; - } if (bodyLength != response->BodyLength) { WLog_WARN(TAG, "http_response_recv: %s unexpected body length: actual: %d, expected: %d", - response->ContentType, bodyLength, response->BodyLength); + response->ContentType, response->BodyLength, bodyLength); + + if (bodyLength > 0) + response->BodyLength = MIN(bodyLength, response->BodyLength); } } -- 2.7.4