aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dlfcn.c2
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 )