Commit 229ccfd0 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ntdll: Do not reject data directories at the end of a file.

Found when wpfgfx_cor3.dll failed to relocate in Bentley CONNECTION Client. Fixes: 56d9e1a8.
parent 6972aa77
...@@ -2612,7 +2612,7 @@ static IMAGE_DATA_DIRECTORY *get_data_dir( IMAGE_NT_HEADERS *nt, SIZE_T total_si ...@@ -2612,7 +2612,7 @@ static IMAGE_DATA_DIRECTORY *get_data_dir( IMAGE_NT_HEADERS *nt, SIZE_T total_si
if (!data->Size) return NULL; if (!data->Size) return NULL;
if (!data->VirtualAddress) return NULL; if (!data->VirtualAddress) return NULL;
if (data->VirtualAddress >= total_size) return NULL; if (data->VirtualAddress >= total_size) return NULL;
if (data->Size >= total_size - data->VirtualAddress) return NULL; if (data->Size > total_size - data->VirtualAddress) return NULL;
return data; return data;
} }
......
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