Commit 97429b32 authored by Alexandre Julliard's avatar Alexandre Julliard

dbghelp: Always initialize section pointer in ImageDirectoryEntryToDataEx.

parent 4cacdc7d
...@@ -448,17 +448,14 @@ PVOID WINAPI ImageDirectoryEntryToDataEx( PVOID base, BOOLEAN image, USHORT dir, ...@@ -448,17 +448,14 @@ PVOID WINAPI ImageDirectoryEntryToDataEx( PVOID base, BOOLEAN image, USHORT dir,
DWORD addr; DWORD addr;
*size = 0; *size = 0;
if (section) *section = NULL;
if (!(nt = RtlImageNtHeader( base ))) return NULL; if (!(nt = RtlImageNtHeader( base ))) return NULL;
if (dir >= nt->OptionalHeader.NumberOfRvaAndSizes) return NULL; if (dir >= nt->OptionalHeader.NumberOfRvaAndSizes) return NULL;
if (!(addr = nt->OptionalHeader.DataDirectory[dir].VirtualAddress)) return NULL; if (!(addr = nt->OptionalHeader.DataDirectory[dir].VirtualAddress)) return NULL;
*size = nt->OptionalHeader.DataDirectory[dir].Size; *size = nt->OptionalHeader.DataDirectory[dir].Size;
if (image || addr < nt->OptionalHeader.SizeOfHeaders) if (image || addr < nt->OptionalHeader.SizeOfHeaders) return (char *)base + addr;
{
if (section) *section = NULL;
return (char *)base + addr;
}
return RtlImageRvaToVa( nt, (HMODULE)base, addr, section ); return RtlImageRvaToVa( nt, (HMODULE)base, addr, section );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment