Author: tfaber Date: Mon May 9 07:34:46 2016 New Revision: 71292
URL: http://svn.reactos.org/svn/reactos?rev=71292&view=rev Log: [WS2_32_NEW] - Add missing null termination for the line buffer in GetProtoGetNextEnt. Patch by Víctor Martínez Calvo. CID 716700 CORE-11218 #resolve
Modified: trunk/reactos/dll/win32/ws2_32_new/src/getproto.c
Modified: trunk/reactos/dll/win32/ws2_32_new/src/getproto.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32_new/src/ge... ============================================================================== --- trunk/reactos/dll/win32/ws2_32_new/src/getproto.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/ws2_32_new/src/getproto.c [iso-8859-1] Mon May 9 07:34:46 2016 @@ -72,7 +72,7 @@ NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, - NULL); + NULL); }
PCHAR @@ -118,6 +118,9 @@ &Read, NULL)) return NULL;
+ /* Null terminate LineBuffer */ + Buffer->LineBuffer[Read] = ANSI_NULL; + /* Find out where the line ends */ p1 = Buffer->LineBuffer; p = strchr(Buffer->LineBuffer, '\n'); @@ -212,7 +215,7 @@ PWSTHREAD Thread; INT ErrorCode; PPROTOENT Protoent; - PVOID GetProtoBuffer; + PVOID GetProtoBuffer; HANDLE DbHandle; DPRINT("getprotobynumber: %lx\n", number);
@@ -276,7 +279,7 @@ PWSTHREAD Thread; INT ErrorCode; PPROTOENT Protoent; - PVOID GetProtoBuffer; + PVOID GetProtoBuffer; HANDLE DbHandle; DPRINT("getprotobyname: %s\n", name);