1
0
mirror of https://github.com/upx/upx synced 2025-10-05 19:20:23 +08:00

pe: added a check for too small object alignment

This commit is contained in:
László Molnár 2007-05-17 18:02:50 +02:00
parent df8acc4ed7
commit 9e92c9ea12
2 changed files with 4 additions and 0 deletions

View File

@ -882,6 +882,8 @@ void PackArmPe::pack(OutputFile *fo)
oh.codesize = osection[1].vsize;
oh.codebase = osection[1].vaddr;
oh.headersize = osection[1].rawdataptr;
if (rvamin < osection[0].rawdataptr)
throwCantPack("object alignment too small");
if (opt->win32_pe.strip_relocs && !isdll)
oh.flags |= RELOCS_STRIPPED;

View File

@ -1021,6 +1021,8 @@ void PackW32Pe::pack(OutputFile *fo)
oh.codebase = osection[1].vaddr;
// oh.headersize = osection[0].rawdataptr;
oh.headersize = rvamin;
if (rvamin < osection[0].rawdataptr)
throwCantPack("object alignment too small");
if (opt->win32_pe.strip_relocs && !isdll)
oh.flags |= RELOCS_STRIPPED;