From ed1610791c0c681ee562bb3997e0f29bfae11b2d Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sun, 2 Feb 2025 11:04:40 -0800 Subject: [PATCH] Revert previous commit, restoring the memcpy() call. The reported issue was due to an error in their test code, not in inflate. This use of memcpy() in inflate is correct. --- inflate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inflate.c b/inflate.c index 76bb8b95..4feac091 100644 --- a/inflate.c +++ b/inflate.c @@ -884,12 +884,12 @@ int ZEXPORT inflate(z_streamp strm, int flush) { if (copy > have) copy = have; if (copy > left) copy = left; if (copy == 0) goto inf_leave; + zmemcpy(put, next, copy); have -= copy; + next += copy; left -= copy; + put += copy; state->length -= copy; - do { - *put++ = *next++; - } while (--copy); break; } Tracev((stderr, "inflate: stored end\n"));