From d596820a3c5eb12b3856493e54722dc683779490 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 20 Aug 2024 10:52:34 -0700 Subject: [PATCH] GUACAMOLE-377: Correct return value confusion in handling of timeout vs. general failure of WaitForMultipleObjects(). The conversion of WAIT_FAILED to a signed int and back may cause the value of result to not actually match the value of the WAIT_FAILED macro due to the difference in size and sign extension during conversion. --- src/protocols/rdp/rdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocols/rdp/rdp.c b/src/protocols/rdp/rdp.c index 4bec5fdef..61e06a05e 100644 --- a/src/protocols/rdp/rdp.c +++ b/src/protocols/rdp/rdp.c @@ -407,7 +407,7 @@ static int rdp_guac_client_wait_for_messages(guac_client* client, GUAC_RDP_MAX_FILE_DESCRIPTORS); /* Wait for data and construct a reasonable frame */ - int result = WaitForMultipleObjects(num_handles, handles, FALSE, + DWORD result = WaitForMultipleObjects(num_handles, handles, FALSE, timeout_msecs); /* Translate WaitForMultipleObjects() return values */