[ros-diffs] [cgutman] 54614: [WS2_32] - Allocate enough memory for the WSAPROTOCOL_INFOW struct

cgutman at svn.reactos.org cgutman at svn.reactos.org
Thu Dec 8 19:16:24 UTC 2011


Author: cgutman
Date: Thu Dec  8 19:16:24 2011
New Revision: 54614

URL: http://svn.reactos.org/svn/reactos?rev=54614&view=rev
Log:
[WS2_32]
- Allocate enough memory for the WSAPROTOCOL_INFOW struct

Modified:
    trunk/reactos/dll/win32/ws2_32/misc/ns.c

Modified: trunk/reactos/dll/win32/ws2_32/misc/ns.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/misc/ns.c?rev=54614&r1=54613&r2=54614&view=diff
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/misc/ns.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/misc/ns.c [iso-8859-1] Thu Dec  8 19:16:24 2011
@@ -393,10 +393,11 @@
 
     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,




More information about the Ros-diffs mailing list