1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Added a check for unsupported coff headers.

committer: mfx <mfx> 1035473178 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2002-10-24 15:26:18 +00:00
parent 204f4eefd8
commit 8744f6bd7f

View File

@ -271,6 +271,8 @@ void PackDjgpp2::pack(OutputFile *fo)
const unsigned hdrsize = 20 + 28 + (40 * coff_hdr.f_nscns);
if (hdrsize < sizeof(coff_hdr) || hdrsize > tpos)
throwCantPack("coff header error");
if (hdrsize > (tpos & 0x1ff))
throwCantPack("unsupported coff header");
ibuf.alloc(usize);
obuf.allocForCompression(usize);