Zebediah Figura : ws2_32: Cast timeval fields to LONGLONG before multiplying.

Alexandre Julliard julliard at winehq.org
Fri Jan 14 15:11:16 CST 2022


Module: wine
Branch: master
Commit: 894679ced80ec4bbedff37babae3f89592bd7ae7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=894679ced80ec4bbedff37babae3f89592bd7ae7

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Thu Jan 13 19:16:14 2022 -0600

ws2_32: Cast timeval fields to LONGLONG before multiplying.

WXWORK passes 300 seconds, which overflows 32-bit multiplication.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52383
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ws2_32/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 0f12a8b8d4a..a7e3e0ab0d7 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -2409,7 +2409,7 @@ int WINAPI select( int count, fd_set *read_ptr, fd_set *write_ptr,
     }
 
     if (timeout)
-        params->timeout = timeout->tv_sec * -10000000 + timeout->tv_usec * -10;
+        params->timeout = (LONGLONG)timeout->tv_sec * -10000000 + (LONGLONG)timeout->tv_usec * -10;
     else
         params->timeout = TIMEOUT_INFINITE;
 




More information about the wine-cvs mailing list