- Acquire the PEB lock before reading Peb->ProcessParameters->Environment in RtlQueryEnvironmentVariable_U. Patch by Mark Jansen.
CORE-10381

svn path=/trunk/; revision=69939
This commit is contained in:
Thomas Faber 2015-11-19 16:03:21 +00:00
parent bd198a5fd5
commit 84db6add79

View file

@ -524,6 +524,7 @@ RtlQueryEnvironmentVariable_U(PWSTR Environment,
{
PPEB Peb = RtlGetCurrentPeb();
if (Peb) {
RtlAcquirePebLock();
Environment = Peb->ProcessParameters->Environment;
SysEnvUsed = TRUE;
}
@ -531,12 +532,12 @@ RtlQueryEnvironmentVariable_U(PWSTR Environment,
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);