diff options
author | Silvio Traversaro <silvio@traversaro.it> | 2023-07-04 08:57:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-04 08:57:43 +0200 |
commit | 057dcdd6899b5a9c5abf6c47607cb95816e053a2 (patch) | |
tree | 95680201f3ee345c0328a8b00b2bc6daac9650db | |
parent | 9077355238a38f51ebdd3cf116612f02b6cd1a1e (diff) | |
parent | fc7c011d1aa182de815ac31906ebc2aa36803bb7 (diff) | |
download | dlfcn-win32-1.4.1.tar.gz dlfcn-win32-1.4.1.tar.bz2 dlfcn-win32-1.4.1.zip |
Merge pull request #111 from pali/masterv1.4.1
Add missing check that section index in get_image_section() is valid
-rw-r--r-- | src/dlfcn.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dlfcn.c b/src/dlfcn.c index c4563d2..cb9f9bb 100644 --- a/src/dlfcn.c +++ b/src/dlfcn.c | |||
@@ -640,7 +640,7 @@ static BOOL get_image_section( HMODULE module, int index, void **ptr, DWORD *siz | |||
640 | if( optionalHeader->Magic != IMAGE_NT_OPTIONAL_HDR_MAGIC ) | 640 | if( optionalHeader->Magic != IMAGE_NT_OPTIONAL_HDR_MAGIC ) |
641 | return FALSE; | 641 | return FALSE; |
642 | 642 | ||
643 | if( index < 0 || index >= IMAGE_NUMBEROF_DIRECTORY_ENTRIES ) | 643 | if( index < 0 || index >= IMAGE_NUMBEROF_DIRECTORY_ENTRIES || index >= optionalHeader->NumberOfRvaAndSizes ) |
644 | return FALSE; | 644 | return FALSE; |
645 | 645 | ||
646 | if( optionalHeader->DataDirectory[index].Size == 0 || optionalHeader->DataDirectory[index].VirtualAddress == 0 ) | 646 | if( optionalHeader->DataDirectory[index].Size == 0 || optionalHeader->DataDirectory[index].VirtualAddress == 0 ) |