https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0d41593749d21c51ee78121f47a50a269ab80b7e

commit 0d41593749d21c51ee78121f47a50a269ab80b7e
Author:     Jérôme Gardou <[email protected]>
AuthorDate: Wed Mar 17 18:00:38 2021 +0100
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Wed Mar 17 18:53:12 2021 +0100

    [WS2_32] Check that the handle table is initialized before accessing it.
---
 dll/win32/ws2_32/src/dsocket.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dll/win32/ws2_32/src/dsocket.c b/dll/win32/ws2_32/src/dsocket.c
index ddc220ef25c..11486c22439 100644
--- a/dll/win32/ws2_32/src/dsocket.c
+++ b/dll/win32/ws2_32/src/dsocket.c
@@ -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;
     }

Reply via email to