[WS2_32] Check that the handle table is initialized before accessing it.

This commit is contained in:
Jérôme Gardou 2021-03-17 18:00:38 +01:00
parent 162f51e6b8
commit 0d41593749

View file

@ -142,8 +142,8 @@ WsSockGetSocket(IN SOCKET Handle)
PWSSOCKET Socket;
/* Let WAH do the translation */
if ((Socket = (PWSSOCKET)WahReferenceContextByHandle(WsSockHandleTable,
(HANDLE)Handle)))
if ((WsSockHandleTable != NULL) &&
(Socket = (PWSSOCKET)WahReferenceContextByHandle(WsSockHandleTable, (HANDLE)Handle)))
{
return Socket;
}