[WS2_32]
authorCameron Gutman <aicommander@gmail.com>
Thu, 8 Dec 2011 19:16:24 +0000 (19:16 +0000)
committerCameron Gutman <aicommander@gmail.com>
Thu, 8 Dec 2011 19:16:24 +0000 (19:16 +0000)
- Allocate enough memory for the WSAPROTOCOL_INFOW struct

svn path=/trunk/; revision=54614

reactos/dll/win32/ws2_32/misc/ns.c

index 6d765fd..5089a0a 100644 (file)
@@ -393,10 +393,11 @@ WSAStringToAddressA(IN     LPSTR AddressString,
 
     if (lpProtocolInfo)
     {
-        len =   WSAPROTOCOL_LEN+1;
+        len = WSAPROTOCOL_LEN+1;
         lpProtoInfoW = HeapAlloc(GetProcessHeap(),
                                  0,
-                                 len * sizeof(WCHAR) );
+                                 FIELD_OFFSET(WSAPROTOCOL_INFOW, szProtocol) +
+                                 (len * sizeof(WCHAR)));
 
         memcpy(lpProtoInfoW,
                lpProtocolInfo,