[MSAFD]
authorThomas Faber <thomas.faber@reactos.org>
Thu, 21 Jun 2012 23:43:24 +0000 (23:43 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Thu, 21 Jun 2012 23:43:24 +0000 (23:43 +0000)
- Gracefully handle lpcbBytesReturned == NULL condition in WSPIoctl. Fixes crash in ws2_32:sock

svn path=/trunk/; revision=56782

reactos/dll/win32/msafd/misc/dllmain.c

index 806b9f1..380cc4a 100644 (file)
@@ -1968,6 +1968,12 @@ WSPIoctl(IN  SOCKET Handle,
        BOOLEAN NeedsCompletion;
     BOOLEAN NonBlocking;
 
+    if (!lpcbBytesReturned)
+    {
+       *lpErrno = WSAEFAULT;
+       return SOCKET_ERROR;
+    }
+
     /* Get the Socket Structure associate to this Socket*/
     Socket = GetSocketStructure(Handle);
     if (!Socket)