From 98973dd8b914aa6971973899abfd4b15353c6367 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Tue, 23 Mar 2021 06:45:01 -0700 Subject: [PATCH] get_te32() when checking DT_HASH chains (MIPS .so) https://github.com/upx/upx/issues/473 modified: p_lx_elf.cpp --- src/p_lx_elf.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index c286577b..9a3e091b 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -1694,8 +1694,9 @@ PackLinuxElf32::invert_pt_dynamic(Elf32_Dyn const *dynp, unsigned headway) } unsigned chmax = 0; for (unsigned j= 0; j < nbucket; ++j) { - if (chmax < buckets[j]) { - chmax = buckets[j]; + unsigned x = get_te32(&buckets[j]); + if (chmax < x) { + chmax = x; } } if ((v_hsh < v_sym) && (v_sym - v_hsh) < @@ -5403,8 +5404,9 @@ PackLinuxElf64::invert_pt_dynamic(Elf64_Dyn const *dynp, upx_uint64_t headway) } unsigned chmax = 0; for (unsigned j= 0; j < nbucket; ++j) { - if (chmax < buckets[j]) { - chmax = buckets[j]; + unsigned x = get_te32(&buckets[j]); + if (chmax < x) { + chmax = x; } } if ((v_hsh < v_sym) && (v_sym - v_hsh) <