Alexandre Julliard : dbghelp: Always initialize section pointer in ImageDirectoryEntryToDataEx.

Alexandre Julliard julliard at winehq.org
Fri Jul 18 06:46:27 CDT 2008


Module: wine
Branch: master
Commit: 97429b32f80773f0b77d4a0d273ba520defa3f2a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=97429b32f80773f0b77d4a0d273ba520defa3f2a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Jul 18 11:16:02 2008 +0200

dbghelp: Always initialize section pointer in ImageDirectoryEntryToDataEx.

---

 dlls/dbghelp/pe_module.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c
index 533cfeb..283962c 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 );
 }




More information about the wine-cvs mailing list