diff --git a/.gitignore b/.gitignore index 0f435ad..a2c05dc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ lzma465.tar.bz2 /upx-lzma-sdk-3.96.tar.gz /upx-4.0.0-src.tar.xz /upx-4.0.1-src.tar.xz +/upx-4.0.2-src.tar.xz diff --git a/510505a85cbe45e51fbd470f1aa8b02157c429d4.patch b/510505a85cbe45e51fbd470f1aa8b02157c429d4.patch deleted file mode 100644 index 89c5e79..0000000 --- a/510505a85cbe45e51fbd470f1aa8b02157c429d4.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- upx-4.0.1-src/src/p_tmt.cpp~ 2022-11-16 16:15:38.000000000 -0600 -+++ upx-4.0.1-src/src/p_tmt.cpp 2023-01-12 13:49:53.599794510 -0600 -@@ -176,10 +176,11 @@ - unsigned const imagesize = get_le32(&ih.imagesize); - unsigned const entry = get_le32(&ih.entry); - unsigned const relocsize = get_le32(&ih.relocsize); -- if (!imagesize -- || file_size <= imagesize -- || file_size <= entry -- || file_size <= relocsize) { -+ if (imagesize < sizeof(ih) -+ || entry < sizeof(ih) -+ || file_size <= imagesize -+ || file_size <= entry -+ || file_size <= relocsize) { - printWarn(getName(), "bad header; imagesize=%#x entry=%#x relocsize=%#x", - imagesize, entry, relocsize); - return 0; -@@ -216,14 +217,14 @@ - obuf.allocForCompression(usize+rsize+128); - - MemBuffer wrkmem; -- wrkmem.alloc(rsize+EXTRA_INFO); // relocations -+ wrkmem.alloc(rsize + EXTRA_INFO + 4); // relocations + original entry point + relocsize - - fi->seek(adam_offset+sizeof(ih),SEEK_SET); - fi->readx(ibuf,usize); - fi->readx(wrkmem+4,rsize); - const unsigned overlay = file_size - fi->tell(); - -- if (find_le32(ibuf,128,get_le32("UPX ")) >= 0) -+ if (find_le32(ibuf, UPX_MIN(128u, usize), get_le32("UPX ")) >= 0) - throwAlreadyPacked(); - if (rsize == 0) - throwCantPack("file is already compressed with another packer"); diff --git a/779b648c5f6aa9b33f4728f79dd4d0efec0bf860.patch b/779b648c5f6aa9b33f4728f79dd4d0efec0bf860.patch deleted file mode 100644 index 8cb8455..0000000 --- a/779b648c5f6aa9b33f4728f79dd4d0efec0bf860.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 779b648c5f6aa9b33f4728f79dd4d0efec0bf860 Mon Sep 17 00:00:00 2001 -From: John Reiser -Date: Wed, 23 Nov 2022 19:49:28 -0800 -Subject: [PATCH] invert_pt_dynamic: fix thinko; PackLinuxElf64help1 insist on - ELF - -https://github.com/upx/upx/issues/631 - modified: src/p_lx_elf.cpp ---- - src/p_lx_elf.cpp | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp -index fa55470f7..b698ee0a2 100644 ---- a/src/p_lx_elf.cpp -+++ b/src/p_lx_elf.cpp -@@ -256,7 +256,8 @@ PackLinuxElf32::PackLinuxElf32help1(InputFile *f) - e_phnum = get_te16(&ehdri.e_phnum); - e_shnum = get_te16(&ehdri.e_shnum); - unsigned const e_phentsize = get_te16(&ehdri.e_phentsize); -- if (ehdri.e_ident[Elf32_Ehdr::EI_CLASS]!=Elf32_Ehdr::ELFCLASS32 -+ if (memcmp((char const *)&ehdri, "\x7f\x45\x4c\x46", 4) // "\177ELF" -+ || ehdri.e_ident[Elf32_Ehdr::EI_CLASS]!=Elf32_Ehdr::ELFCLASS32 - || sizeof(Elf32_Phdr) != e_phentsize - || (Elf32_Ehdr::ELFDATA2MSB == ehdri.e_ident[Elf32_Ehdr::EI_DATA] - && &N_BELE_RTP::be_policy != bele) -@@ -761,7 +762,8 @@ PackLinuxElf64::PackLinuxElf64help1(InputFile *f) - e_phnum = get_te16(&ehdri.e_phnum); - e_shnum = get_te16(&ehdri.e_shnum); - unsigned const e_phentsize = get_te16(&ehdri.e_phentsize); -- if (ehdri.e_ident[Elf64_Ehdr::EI_CLASS]!=Elf64_Ehdr::ELFCLASS64 -+ if (memcmp((char const *)&ehdri, "\x7f\x45\x4c\x46", 4) // "\177ELF" -+ || ehdri.e_ident[Elf64_Ehdr::EI_CLASS]!=Elf64_Ehdr::ELFCLASS64 - || sizeof(Elf64_Phdr) != e_phentsize - || (Elf64_Ehdr::ELFDATA2MSB == ehdri.e_ident[Elf64_Ehdr::EI_DATA] - && &N_BELE_RTP::be_policy != bele) -@@ -5780,7 +5782,7 @@ PackLinuxElf64::invert_pt_dynamic(Elf64_Dyn const *dynp, upx_uint64_t headway) - } - if (file_size <= dt_offsets[n_off]) { - char msg[60]; snprintf(msg, sizeof(msg), "bad DT_{%#x} = %#x (beyond EOF)", -- dt_names[k], dt_offsets[n_off]); -+ k, dt_offsets[n_off]); - throwCantPack(msg); - } - n_off += !!dt_offsets[n_off]; diff --git a/sources b/sources index 7cfe53e..31e3a65 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (upx-4.0.1-src.tar.xz) = f2e42c83fd4a0d273a20c8b0f0d1eb201edcd1f10c779d2a6e8ac0812741c3af0c887382e54894190ecc4c7002a910524b2ed79ae7a7b595b8392598ad2e1235 +SHA512 (upx-4.0.2-src.tar.xz) = 0aafbaf97a25e9cd1866d03358f5eceab2c0ba4b2f3acdd58178b41c32af58335b6cb843d83f3398d4ceedc238bfcd95f86a20c38a11d5e4e8af6a28c7e8b82e diff --git a/upx.spec b/upx.spec index 3969dbe..9654b58 100644 --- a/upx.spec +++ b/upx.spec @@ -1,13 +1,11 @@ Name: upx -Version: 4.0.1 -Release: 3%{?dist} +Version: 4.0.2 +Release: 1%{?dist} Summary: Ultimate Packer for eXecutables License: GPLv2+ and Public Domain URL: https://github.com/upx/upx Source0: %{url}/releases/download/v%{version}/%{name}-%{version}-src.tar.xz -Patch0: 779b648c5f6aa9b33f4728f79dd4d0efec0bf860.patch -Patch1: 510505a85cbe45e51fbd470f1aa8b02157c429d4.patch BuildRequires: make BuildRequires: gcc-c++ @@ -26,8 +24,6 @@ executables suffer no memory overhead or other drawbacks. %prep %setup -qn %{name}-%{version}-src -%patch0 -p1 -%patch1 -p1 %build %cmake @@ -47,6 +43,9 @@ rm -f %{buildroot}%{_datadir}/doc/upx/* %changelog +* Wed Feb 01 2023 Gwyn Ciesla - 4.0.2-1 +- 4.0.2 + * Sat Jan 21 2023 Fedora Release Engineering - 4.0.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild