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

Alexandre Julliard julliard at winehq.org
Thu Jul 9 10:57:02 CDT 2009


Module: wine
Branch: master
Commit: 48656f5596beecd956be60661d5a8e6eab24e09b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=48656f5596beecd956be60661d5a8e6eab24e09b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jul  9 15:21:30 2009 +0200

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

---

 dlls/ws2_32/socket.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 5516260..464e890 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -4409,6 +4409,12 @@ INT WINAPI WSARecvFrom( SOCKET s, LPWSABUF lpBuffers, DWORD dwBufferCount,
     wsa->first_iovec = 0;
     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_len  = lpBuffers[i].len;
     }




More information about the wine-cvs mailing list