[PATCH] ntdll: Fix overflow if running 32bit app w/ wine64
Dmitry Timoshkov
dmitry at baikal.ru
Wed Oct 17 01:19:04 CDT 2018
Brendan McGrath <brendan at redmandi.com> wrote:
> + struct nt
> + {
> + DWORD Signature;
> + IMAGE_FILE_HEADER FileHeader;
> + union
> + {
> + IMAGE_OPTIONAL_HEADER32 hdr32;
> + IMAGE_OPTIONAL_HEADER64 hdr64;
> + } opt;
> + };
> +
> + struct nt *nt = (struct nt*) RtlImageNtHeader( NtCurrentTeb()->Peb->ImageBaseAddress );
> + if (nt->opt.hdr32.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
> + if (!reserve_size) reserve_size = nt->opt.hdr32.SizeOfStackReserve;
> + if (!commit_size) commit_size = nt->opt.hdr32.SizeOfStackCommit;
> + } else {
> + if (!reserve_size) reserve_size = nt->opt.hdr64.SizeOfStackReserve;
> + if (!commit_size) commit_size = nt->opt.hdr64.SizeOfStackCommit;
> + }
> + TRACE("reserve_size: %lu, commit_size: %lu", reserve_size, commit_size);
Indentation seems to be broken by shifting lower lines by 1 space left.
--
Dmitry.
More information about the wine-devel
mailing list