mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[KERNEL32] Check for null buffer in GetEnviornmentVariableW
Checks if lpBuffer is null before writing the null terminator to the end of it. This prevents some crashes in the kernel32 winetest sync to wine-10.0.
This commit is contained in:
@@ -204,7 +204,8 @@ GetEnvironmentVariableW(IN LPCWSTR lpName,
|
||||
return 0;
|
||||
}
|
||||
|
||||
lpBuffer[VarValue.Length / sizeof(WCHAR)] = UNICODE_NULL;
|
||||
if (lpBuffer)
|
||||
lpBuffer[VarValue.Length / sizeof(WCHAR)] = UNICODE_NULL;
|
||||
|
||||
return (VarValue.Length / sizeof(WCHAR));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user