overlapped memcpy() happens in #ifndef NOMEMCPY section

(explode.c, inflate.c) and it causes SIGABRT.
replace with memmove() to fix.

ok tb@
This commit is contained in:
uaa
2025-01-13 09:55:45 +00:00
parent 8af50dedda
commit 89a66a1dff
3 changed files with 32 additions and 1 deletions
+1 -1
View File
@@ -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/
+20
View File
@@ -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;
}
+11
View File
@@ -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;
}