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>
This commit is contained in:
Paul Gofman 2022-03-05 22:04:06 +03:00 committed by Alexandre Julliard
parent b2d1d09083
commit 9744055cf4
1 changed files with 6 additions and 0 deletions

View File

@ -2946,6 +2946,12 @@ int WINAPI setsockopt( SOCKET s, int level, int optname, const char *optval, int
break; break;
case IPPROTO_IP: case IPPROTO_IP:
if (optlen < 0)
{
SetLastError(WSAENOBUFS);
return SOCKET_ERROR;
}
switch(optname) switch(optname)
{ {
case IP_ADD_MEMBERSHIP: case IP_ADD_MEMBERSHIP: