ws2_32: Check buffers before recvmsg() to trigger write watches.

This commit is contained in:
Alexandre Julliard 2009-07-09 15:21:30 +02:00
parent 0a2380f982
commit 48656f5596
1 changed files with 6 additions and 0 deletions

View File

@ -4409,6 +4409,12 @@ INT WINAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
wsa->first_iovec = 0; wsa->first_iovec = 0;
for (i = 0; i < dwBufferCount; i++) for (i = 0; i < dwBufferCount; i++)
{ {
/* check buffer first to trigger write watches */
if (IsBadWritePtr( lpBuffers[i].buf, lpBuffers[i].len ))
{
err = WSAEFAULT;
goto error;
}
wsa->iovec[i].iov_base = lpBuffers[i].buf; wsa->iovec[i].iov_base = lpBuffers[i].buf;
wsa->iovec[i].iov_len = lpBuffers[i].len; wsa->iovec[i].iov_len = lpBuffers[i].len;
} }