- Gracefully handle lpcbBytesReturned == NULL condition in WSPIoctl. Fixes crash in ws2_32:sock

svn path=/trunk/; revision=56782
This commit is contained in:
Thomas Faber 2012-06-21 23:43:24 +00:00
parent bbb72145fa
commit f59ea8fb2f

View file

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