Module: wine Branch: master Commit: 2a573c6f4899e7ccdb0492ba5029c7f8506590e4 URL: https://source.winehq.org/git/wine.git/?a=commit;h=2a573c6f4899e7ccdb0492ba5...
Author: Zebediah Figura z.figura12@gmail.com Date: Thu Sep 24 22:21:04 2020 -0500
ws2_32: Always return WSAEINVAL if AF_UNSPEC is used with a zero protocol.
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ws2_32/socket.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 1ac1f77d6e..5089029f4b 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -7648,7 +7648,13 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol, protocol = lpProtocolInfo->iProtocol; }
- if (!type && (af || protocol)) + if (!af && !protocol) + { + WSASetLastError(WSAEINVAL); + return INVALID_SOCKET; + } + + if (!type) { int autoproto = protocol; WSAPROTOCOL_INFOW infow;