Author: cwittich
Date: Wed Sep 17 09:03:05 2008
New Revision: 36285
URL:
http://svn.reactos.org/svn/reactos?rev=36285&view=rev
Log:
fix a kernel32 environ winetest
Modified:
trunk/reactos/dll/win32/kernel32/misc/env.c
Modified: trunk/reactos/dll/win32/kernel32/misc/env.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/en…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/env.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/misc/env.c [iso-8859-1] Wed Sep 17 09:03:05 2008
@@ -425,6 +425,10 @@
return 0;
}
+ /* make sure we don't overflow the maximum ANSI_STRING size */
+ if (nSize > 0x7fff)
+ nSize = 0x7fff;
+
Destination.Length = 0;
Destination.MaximumLength = (USHORT)nSize;
Destination.Buffer = lpDst;
@@ -491,6 +495,10 @@
RtlInitUnicodeString (&Source,
(LPWSTR)lpSrc);
+ /* make sure we don't overflow the maximum UNICODE_STRING size */
+ if (nSize > 0x7fff)
+ nSize = 0x7fff;
+
Destination.Length = 0;
Destination.MaximumLength = (USHORT)nSize * sizeof(WCHAR);
Destination.Buffer = lpDst;