зеркало из https://github.com/mozilla/gecko-dev.git
Bug 751585: Don't enforce ASLR for binary components on XP, because system DLLs don't have ASLR and trigger false positives. r=bsmedberg,ehsan
This commit is contained in:
Родитель
568a44dc63
Коммит
cea78898b8
|
@ -191,6 +191,18 @@ private:
|
|||
void* mRealView;
|
||||
};
|
||||
|
||||
bool
|
||||
IsVistaOrLater()
|
||||
{
|
||||
OSVERSIONINFO info;
|
||||
|
||||
ZeroMemory(&info, sizeof(OSVERSIONINFO));
|
||||
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
GetVersionEx(&info);
|
||||
|
||||
return info.dwMajorVersion >= 6;
|
||||
}
|
||||
|
||||
bool
|
||||
CheckASLR(const wchar_t* path)
|
||||
{
|
||||
|
@ -454,7 +466,7 @@ continue_loading:
|
|||
return STATUS_DLL_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (!CheckASLR(full_fname)) {
|
||||
if (IsVistaOrLater() && !CheckASLR(full_fname)) {
|
||||
printf_stderr("LdrLoadDll: Blocking load of '%s'. XPCOM components must support ASLR.\n", dllName);
|
||||
return STATUS_DLL_NOT_FOUND;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче