From 1bed77e4d3da75fee0df03940ed5469a4f5c8b1c Mon Sep 17 00:00:00 2001 From: John Reiser Date: Tue, 20 Dec 2022 07:21:02 -0800 Subject: [PATCH] 'sizeof' returns size_t, which on i386 is not as wide as off_t https://github.com/upx/upx/issues/629 https://github.com/upx/upx/issues/635 modified: p_lx_elf.cpp --- src/p_lx_elf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index a1f6fbf9..c493a5a9 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -5408,7 +5408,7 @@ void PackLinuxElf64::unpack(OutputFile *fo) { // Recover from some piracy [also serves as error tolerance :-) ] b_info b_peek; fi->readx(&b_peek, sizeof(b_peek)); - upx_off_t pos = fi->seek(0u - sizeof(b_peek), SEEK_CUR); + upx_off_t pos = fi->seek(-(off_t)sizeof(b_peek), SEEK_CUR); if (b_peek.sz_unc != size || b_peek.b_method != prev_method) { opt->info_mode++;