Commit 7a7b8288 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Only free reserved memory for DYNAMIC_BASE binaries.

To avoid triggering more pointer-truncation bugs in applications.
parent 0a5f7a71
......@@ -4397,7 +4397,8 @@ void virtual_set_large_address_space(void)
if (is_wow64())
user_space_wow_limit = ((main_image_info.ImageCharacteristics & IMAGE_FILE_LARGE_ADDRESS_AWARE) ? limit_4g : limit_2g) - 1;
#ifndef __APPLE__ /* don't free the zerofill section on macOS */
else if (main_image_info.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA)
else if ((main_image_info.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA) &&
(main_image_info.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE))
free_reserved_memory( 0, (char *)0x7ffe0000 );
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment