Static executable with 4 PT_LOAD has only ELF headers in first PT_LOAD

https://github.com/upx/upx/issues/615
This commit is contained in:
John Reiser 2022-11-02 10:03:25 -07:00 committed by Markus F.X.J. Oberhumer
parent 81e11987a2
commit c8a3acbba8

View File

@ -4448,7 +4448,7 @@ int PackLinuxElf64::pack2(OutputFile *fo, Filter &ft)
}
}
else // main program, not shared library
if (hdr_u_len < (u64_t)x.size) {
if (hdr_u_len <= (u64_t)x.size) {
if (0 == nx) { // 1st PT_LOAD64 must cover Ehdr at 0==p_offset
unsigned const delta = hdr_u_len;
if (ft.id < 0x40) {