Commit 0b02d25f authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

ws2_32: Avoid using sizeof on structs with variable length array.

parent 15bef00d
......@@ -1912,7 +1912,7 @@ static int WS2_register_async_shutdown( SOCKET s, int type )
TRACE("s %ld type %d\n", s, type);
wsa = HeapAlloc( GetProcessHeap(), 0, sizeof(*wsa) );
wsa = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( struct ws2_async, iovec[1] ));
if ( !wsa )
return WSAEFAULT;
......@@ -2450,7 +2450,7 @@ static BOOL WINAPI WS2_ConnectEx(SOCKET s, const struct WS_sockaddr* name, int n
FD_WINE_CONNECTED|FD_WINE_LISTENING);
/* Indirectly call WSASend */
if (!(wsa = HeapAlloc( GetProcessHeap(), 0, sizeof(*wsa) )))
if (!(wsa = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( struct ws2_async, iovec[1] ))))
{
SetLastError(WSAEFAULT);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment