ws2_32: Don't call WS_EnterSingleProtocol[A|W] on unsupported protocols (valgrind)

Bruno Jesus 00cpxxx at
Sun Jun 15 16:54:54 CDT 2014

If the requested protocol list has garbage after the last good
protocol WS_EnterSingleProtocol would be called and do a memset at
non-allocated memory.

-------------- next part --------------
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index e31f396..10857dc 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -1822,6 +1822,7 @@ static INT WS_EnumProtocols( BOOL unicode, const INT *protocols, LPWSAPROTOCOL_I
     for (i = items = 0; protocols[i]; i++)
+        if (!supported_protocol(protocols[i])) continue;
         if (unicode)
             if (WS_EnterSingleProtocolW( protocols[i], &info.w[items] ))

More information about the wine-patches mailing list