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:
parent
df8acc4ed7
commit
9e92c9ea12
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user