From 89a66a1dff2e6f28933fc45957b6b62615dbfd71 Mon Sep 17 00:00:00 2001 From: uaa Date: Mon, 13 Jan 2025 09:55:45 +0000 Subject: [PATCH] overlapped memcpy() happens in #ifndef NOMEMCPY section (explode.c, inflate.c) and it causes SIGABRT. replace with memmove() to fix. ok tb@ --- archivers/unzip/Makefile | 2 +- archivers/unzip/patches/patch-explode_c | 20 ++++++++++++++++++++ archivers/unzip/patches/patch-inflate_c | 11 +++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 archivers/unzip/patches/patch-explode_c create mode 100644 archivers/unzip/patches/patch-inflate_c diff --git a/archivers/unzip/Makefile b/archivers/unzip/Makefile index df3f73aca92..68bf503210d 100644 --- a/archivers/unzip/Makefile +++ b/archivers/unzip/Makefile @@ -5,7 +5,7 @@ COMMENT = extract, list & test files in a ZIP archive VERSION = 6.0 DISTNAME = unzip${VERSION:S/.//} PKGNAME = unzip-${VERSION} -REVISION = 17 +REVISION = 18 CATEGORIES = archivers SITES = ${SITE_SOURCEFORGE:=infozip/} \ ftp://ftp.info-zip.org/pub/infozip/src/ diff --git a/archivers/unzip/patches/patch-explode_c b/archivers/unzip/patches/patch-explode_c new file mode 100644 index 00000000000..dfe72b7d701 --- /dev/null +++ b/archivers/unzip/patches/patch-explode_c @@ -0,0 +1,20 @@ +--- explode.c.orig Sun Dec 2 03:20:24 2007 ++++ explode.c Mon Jan 13 18:12:59 2025 +@@ -336,7 +336,7 @@ unsigned bdl; /* number of distance + #ifndef NOMEMCPY + if (w - d >= e) /* (this test assumes unsigned comparison) */ + { +- memcpy(redirSlide + w, redirSlide + d, e); ++ memmove(redirSlide + w, redirSlide + d, e); + w += e; + d += e; + } +@@ -454,7 +454,7 @@ unsigned bdl; /* number of distance low bits + #ifndef NOMEMCPY + if (w - d >= e) /* (this test assumes unsigned comparison) */ + { +- memcpy(redirSlide + w, redirSlide + d, e); ++ memmove(redirSlide + w, redirSlide + d, e); + w += e; + d += e; + } diff --git a/archivers/unzip/patches/patch-inflate_c b/archivers/unzip/patches/patch-inflate_c new file mode 100644 index 00000000000..16d51dd08fa --- /dev/null +++ b/archivers/unzip/patches/patch-inflate_c @@ -0,0 +1,11 @@ +--- inflate.c.orig Wed Jul 30 10:31:08 2008 ++++ inflate.c Mon Jan 13 18:09:38 2025 +@@ -1018,7 +1018,7 @@ unsigned bl, bd; /* number of bits decoded by t + if ((unsigned)w - d >= e) + /* (this test assumes unsigned comparison) */ + { +- memcpy(redirSlide + (unsigned)w, redirSlide + d, e); ++ memmove(redirSlide + (unsigned)w, redirSlide + d, e); + w += e; + d += e; + }