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:
Kyle Huey 2012-05-07 13:02:57 -07:00
Родитель 568a44dc63
Коммит cea78898b8
1 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -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;
}