From 9e1fe26d120edda1adc35a99b859c47106dd9867 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 4 Apr 2012 11:09:44 +0000 Subject: [PATCH] * hookapi.cc (rvadelta): Compute max_size using SizeOfRawData rather than VirtualSize. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/hookapi.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3ac3e33c9..33f507764 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2012-04-04 Corinna Vinschen + + * hookapi.cc (rvadelta): Compute max_size using SizeOfRawData rather + than VirtualSize. + 2012-04-04 Corinna Vinschen * passwd.cc (_getpass_close_fd): New static pthread cleanup handler. diff --git a/winsup/cygwin/hookapi.cc b/winsup/cygwin/hookapi.cc index 11280c6a2..ba9d55112 100644 --- a/winsup/cygwin/hookapi.cc +++ b/winsup/cygwin/hookapi.cc @@ -57,7 +57,7 @@ rvadelta (PIMAGE_NT_HEADERS pnt, DWORD import_rva, DWORD &max_size) && (section[i].VirtualAddress + section[i].Misc.VirtualSize) > import_rva) // if (ascii_strncasematch ((char *) section[i].Name, ".idata", IMAGE_SIZEOF_SHORT_NAME)) { - max_size = section[i].Misc.VirtualSize + max_size = section[i].SizeOfRawData - (import_rva - section[i].VirtualAddress); return section[i].VirtualAddress - section[i].PointerToRawData; }