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

Abandon when outrageous Elf64_Dyn.d_tag

https://github.com/upx/upx/issues/235  POC8
	modified:   p_lx_elf.cpp
This commit is contained in:
John Reiser 2018-12-15 19:35:13 -08:00
parent 780a4347b8
commit 91b81b587b

View File

@ -4690,6 +4690,11 @@ PackLinuxElf64::invert_pt_dynamic(Elf64_Dyn const *dynp)
if (dynp)
for (; ; ++ndx, ++dynp) {
upx_uint64_t const d_tag = get_te64(&dynp->d_tag);
if (d_tag>>32) { // outrageous
char msg[50]; snprintf(msg, sizeof(msg),
"bad Elf64_Dyn[%d].d_tag %#lx", -1+ ndx, (long unsigned)d_tag);
throwCantPack(msg);
}
if (d_tag < DT_NUM) {
dt_table[d_tag] = ndx;
}