ws2_32: Disallow NULL in socket lookups.

NULL means an unused slot, not a valid socket.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2021-08-24 21:50:39 +09:00 committed by Alexandre Julliard
parent ffe20add58
commit ee2e5c0242
1 changed files with 4 additions and 0 deletions

View File

@ -379,6 +379,8 @@ static BOOL socket_list_find( SOCKET socket )
{
unsigned int i;
if (!socket) return FALSE;
EnterCriticalSection( &cs_socket_list );
for (i = 0; i < socket_list_size; ++i)
{
@ -397,6 +399,8 @@ static BOOL socket_list_remove( SOCKET socket )
{
unsigned int i;
if (!socket) return FALSE;
EnterCriticalSection(&cs_socket_list);
for (i = 0; i < socket_list_size; ++i)
{