From ab0266a36271746cea957f9edefc2ccf78aa2074 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sat, 1 Feb 2025 17:09:32 -0800 Subject: Avoid use of memcpy() in inflate when areas can overlap. --- inflate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inflate.c') diff --git a/inflate.c b/inflate.c index 4feac09..76bb8b9 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")); -- cgit v1.2.3-55-g6feb