Module: wine Branch: master Commit: 9744055cf4d1c53ea5ca611ccb3c3b8e471e5147 URL: https://source.winehq.org/git/wine.git/?a=commit;h=9744055cf4d1c53ea5ca611cc...
Author: Paul Gofman pgofman@codeweavers.com Date: Sat Mar 5 22:04:06 2022 +0300
ws2_32: Return WSAENOBUFS from setsockopt() for IPPROTO_IP with negative optlen.
Signed-off-by: Paul Gofman pgofman@codeweavers.com Signed-off-by: Zebediah Figura zfigura@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ws2_32/socket.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index efc0a5b488a..40d86becef9 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2946,6 +2946,12 @@ int WINAPI setsockopt( SOCKET s, int level, int optname, const char *optval, int break;
case IPPROTO_IP: + if (optlen < 0) + { + SetLastError(WSAENOBUFS); + return SOCKET_ERROR; + } + switch(optname) { case IP_ADD_MEMBERSHIP: