From 97429b32f80773f0b77d4a0d273ba520defa3f2a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 18 Jul 2008 11:16:02 +0200 Subject: [PATCH] dbghelp: Always initialize section pointer in ImageDirectoryEntryToDataEx. --- dlls/dbghelp/pe_module.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index 533cfeb6037..283962cb367 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -448,17 +448,14 @@ PVOID WINAPI ImageDirectoryEntryToDataEx( PVOID base, BOOLEAN image, USHORT dir, DWORD addr; *size = 0; + if (section) *section = NULL; if (!(nt = RtlImageNtHeader( base ))) return NULL; if (dir >= nt->OptionalHeader.NumberOfRvaAndSizes) return NULL; if (!(addr = nt->OptionalHeader.DataDirectory[dir].VirtualAddress)) return NULL; *size = nt->OptionalHeader.DataDirectory[dir].Size; - if (image || addr < nt->OptionalHeader.SizeOfHeaders) - { - if (section) *section = NULL; - return (char *)base + addr; - } + if (image || addr < nt->OptionalHeader.SizeOfHeaders) return (char *)base + addr; return RtlImageRvaToVa( nt, (HMODULE)base, addr, section ); } -- 2.11.4.GIT