[gateway,arm] fix input string length check

This commit is contained in:
Armin Novak 2023-09-15 07:41:00 +02:00 committed by akallabeth
parent be7f2979ee
commit 4152ce5dee

View File

@ -790,7 +790,7 @@ static BOOL arm_handle_request_ok(rdpArm* arm, const HttpResponse* response)
{
const size_t len = http_response_get_body_length(response);
const char* msg = http_response_get_body(response);
if (strnlen(msg, len) >= len)
if (strnlen(msg, len + 1) > len)
return FALSE;
WLog_DBG(TAG, "Got HTTP Response data: %s", msg);
@ -808,7 +808,7 @@ static BOOL arm_handle_bad_request(rdpArm* arm, const HttpResponse* response, BO
const size_t len = http_response_get_body_length(response);
const char* msg = http_response_get_body(response);
if (strnlen(msg, len) >= len)
if (strnlen(msg, len + 1) > len)
return FALSE;
WLog_DBG(TAG, "Got HTTP Response data: %s", msg);