From 8744f6bd7fc07cc6c44dd6d16fd5120cda137d0b Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Thu, 24 Oct 2002 15:26:18 +0000 Subject: [PATCH] Added a check for unsupported coff headers. committer: mfx 1035473178 +0000 --- src/p_djgpp2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_djgpp2.cpp b/src/p_djgpp2.cpp index 1af42c6a..4cc3106b 100644 --- a/src/p_djgpp2.cpp +++ b/src/p_djgpp2.cpp @@ -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);