Jeff Zaroyko : ws2_32: Test WSAAccept optional callback parameter before trying to use it.

Alexandre Julliard julliard at winehq.org
Thu Nov 6 08:26:06 CST 2008


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

Author: Jeff Zaroyko <jeffz at jeffz.name>
Date:   Thu Nov  6 19:35:43 2008 +1100

ws2_32: Test WSAAccept optional callback parameter before trying to use it.

---

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

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index afa33ac..bc971f1 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -4386,6 +4386,8 @@ SOCKET WINAPI WSAAccept( SOCKET s, struct WS_sockaddr *addr, LPINT addrlen,
 
        if (cs == SOCKET_ERROR) return SOCKET_ERROR;
 
+       if (!lpfnCondition) return cs;
+
        CallerId.buf = (char *)&src_addr;
        CallerId.len = sizeof(src_addr);
 
@@ -4428,7 +4430,7 @@ SOCKET WINAPI WSAAccept( SOCKET s, struct WS_sockaddr *addr, LPINT addrlen,
                        FIXME("Unknown return type from Condition function\n");
                        SetLastError(WSAENOTSOCK);
                        return SOCKET_ERROR;
-               }
+       }
 }
 
 /***********************************************************************




More information about the wine-cvs mailing list