mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[VCRUNTIME] Fix a bug in x64 __security_init_cookie
This commit is contained in:
@@ -70,16 +70,17 @@ void __security_init_cookie(void)
|
||||
randomValue += GetCurrentProcessId();
|
||||
randomValue = _rotlptr(randomValue, GetCurrentProcessId() >> 2);
|
||||
|
||||
if (randomValue == DEFAULT_SECURITY_COOKIE)
|
||||
{
|
||||
randomValue++;
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
/* Zero out highest 16 bits */
|
||||
randomValue &= 0x0000FFFFFFFFFFFFull;
|
||||
#endif
|
||||
|
||||
/* Avoid the default security cookie */
|
||||
if (randomValue == DEFAULT_SECURITY_COOKIE)
|
||||
{
|
||||
randomValue++;
|
||||
}
|
||||
|
||||
__security_cookie = randomValue;
|
||||
__security_cookie_complement = ~randomValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user