Ričardas Barkauskas <miegalius(a)gmail.com> writes:
> @@ -282,8 +282,12 @@ static BOOL find_pe_resource( HFILE lzfd, DWORD *resLen, DWORD *resOff )
> }
>
> /* Read in resource section */
> - resSectionSize = sections[i].SizeOfRawData;
> - resSection = HeapAlloc( GetProcessHeap(), 0, resSectionSize );
> + if ( sections[i].SizeOfRawData < sections[i].Misc.VirtualSize )
> + resSectionSize = sections[i].SizeOfRawData;
> + else
> + resSectionSize = sections[i].Misc.VirtualSize;
> +
> + resSection = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sections[i].Misc.VirtualSize );
That won't work, the data won't be zero since you'll be reading from the
filepast the end of the section.
--
Alexandre Julliard
julliard(a)winehq.org