Author: tfaber
Date: Thu Nov 19 16:03:21 2015
New Revision: 69939
URL:
http://svn.reactos.org/svn/reactos?rev=69939&view=rev
Log:
[RTL]
- Acquire the PEB lock before reading Peb->ProcessParameters->Environment in
RtlQueryEnvironmentVariable_U. Patch by Mark Jansen.
CORE-10381
Modified:
trunk/reactos/lib/rtl/env.c
Modified: trunk/reactos/lib/rtl/env.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/env.c?rev=69939&am…
==============================================================================
--- trunk/reactos/lib/rtl/env.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/env.c [iso-8859-1] Thu Nov 19 16:03:21 2015
@@ -524,6 +524,7 @@
{
PPEB Peb = RtlGetCurrentPeb();
if (Peb) {
+ RtlAcquirePebLock();
Environment = Peb->ProcessParameters->Environment;
SysEnvUsed = TRUE;
}
@@ -531,12 +532,12 @@
if (Environment == NULL)
{
+ if (SysEnvUsed)
+ RtlReleasePebLock();
return(STATUS_VARIABLE_NOT_FOUND);
}
Value->Length = 0;
- if (SysEnvUsed)
- RtlAcquirePebLock();
wcs = Environment;
DPRINT("Starting search at :%p\n", wcs);