Author: tfaber
Date: Mon Feb 20 16:33:44 2017
New Revision: 73861
URL:
http://svn.reactos.org/svn/reactos?rev=73861&view=rev
Log:
[WS2_32]
- Re-apply null termination fix in GetProtoGetNextEnt, which was lost in ws2_32_new work.
CID 716700
CORE-11218
Modified:
trunk/reactos/dll/win32/ws2_32/src/getproto.c
Modified: trunk/reactos/dll/win32/ws2_32/src/getproto.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ws2_32/src/getpr…
==============================================================================
--- trunk/reactos/dll/win32/ws2_32/src/getproto.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/ws2_32/src/getproto.c [iso-8859-1] Mon Feb 20 16:33:44 2017
@@ -145,12 +145,13 @@
/* Read 512 bytes */
if (!ReadFile(DbHandle,
Buffer->LineBuffer,
- 512,
+ sizeof(Buffer->LineBuffer) - 1,
&Read,
NULL)) return NULL;
/* Find out where the line ends */
p1 = Buffer->LineBuffer;
+ Buffer->LineBuffer[Read] = ANSI_NULL;
p = strchr(Buffer->LineBuffer, '\n');
/* Bail out if the file is parsed */
@@ -243,7 +244,7 @@
PWSTHREAD Thread;
INT ErrorCode;
PPROTOENT Protoent;
- PVOID GetProtoBuffer;
+ PVOID GetProtoBuffer;
HANDLE DbHandle;
DPRINT("getprotobynumber: %lx\n", number);
@@ -307,7 +308,7 @@
PWSTHREAD Thread;
INT ErrorCode;
PPROTOENT Protoent;
- PVOID GetProtoBuffer;
+ PVOID GetProtoBuffer;
HANDLE DbHandle;
DPRINT("getprotobyname: %s\n", name);