Author: tfaber
Date: Sun Apr 3 20:48:51 2016
New Revision: 71097
URL:
http://svn.reactos.org/svn/reactos?rev=71097&view=rev
Log:
[KERNEL32]
- Correctly calculate the buffer size if the PATH variable is set but empty in
BasepComputeProcessPath. Yes, this is a bug in Windows.
CORE-11080 #resolve
Modified:
trunk/reactos/dll/win32/kernel32/client/path.c
Modified: trunk/reactos/dll/win32/kernel32/client/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/path.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/path.c [iso-8859-1] Sun Apr 3 20:48:51 2016
@@ -210,9 +210,13 @@
}
else
{
- /* Add the length of the PATH variable */
+ /* Add the length of the PATH variable unless it's empty */
ASSERT(!(EnvPath.Length & 1));
- PathLengthInBytes += (EnvPath.Length + sizeof(L';'));
+ if (EnvPath.Length)
+ {
+ /* Reserve space for the variable and a semicolon */
+ PathLengthInBytes += (EnvPath.Length + sizeof(L';'));
+ }
}
break;