Paul Gofman : ws2_32: Return WSAEFAULT from setsockopt() for IP_MULTICAST_TTL with zero optlen.
Module: wine Branch: master Commit: 5f9da35af1a0d82ceffabac27c57122bda1fcf2e URL: https://source.winehq.org/git/wine.git/?a=commit;h=5f9da35af1a0d82ceffabac27... Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Mar 8 12:22:45 2022 +0300 ws2_32: Return WSAEFAULT from setsockopt() for IP_MULTICAST_TTL with zero optlen. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/socket.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 816ca828b90..ed2889b3eb0 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2989,6 +2989,11 @@ int WINAPI setsockopt( SOCKET s, int level, int optname, const char *optval, int return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_MULTICAST_LOOP, optval, optlen ); case IP_MULTICAST_TTL: + if (!optlen) + { + SetLastError( WSAEFAULT ); + return -1; + } return server_setsockopt( s, IOCTL_AFD_WINE_SET_IP_MULTICAST_TTL, optval, optlen ); case IP_OPTIONS:
participants (1)
-
Alexandre Julliard