diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2025-02-02 11:04:40 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2025-02-02 11:06:17 -0800 |
commit | ed1610791c0c681ee562bb3997e0f29bfae11b2d (patch) | |
tree | 3a44a36f2235d384b3b5a95ea06f1da17c94693f /inflate.c | |
parent | ab0266a36271746cea957f9edefc2ccf78aa2074 (diff) | |
download | zlib-ed1610791c0c681ee562bb3997e0f29bfae11b2d.tar.gz zlib-ed1610791c0c681ee562bb3997e0f29bfae11b2d.tar.bz2 zlib-ed1610791c0c681ee562bb3997e0f29bfae11b2d.zip |
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.
Diffstat (limited to 'inflate.c')
-rw-r--r-- | inflate.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -884,12 +884,12 @@ int ZEXPORT inflate(z_streamp strm, int flush) { | |||
884 | if (copy > have) copy = have; | 884 | if (copy > have) copy = have; |
885 | if (copy > left) copy = left; | 885 | if (copy > left) copy = left; |
886 | if (copy == 0) goto inf_leave; | 886 | if (copy == 0) goto inf_leave; |
887 | zmemcpy(put, next, copy); | ||
887 | have -= copy; | 888 | have -= copy; |
889 | next += copy; | ||
888 | left -= copy; | 890 | left -= copy; |
891 | put += copy; | ||
889 | state->length -= copy; | 892 | state->length -= copy; |
890 | do { | ||
891 | *put++ = *next++; | ||
892 | } while (--copy); | ||
893 | break; | 893 | break; |
894 | } | 894 | } |
895 | Tracev((stderr, "inflate: stored end\n")); | 895 | Tracev((stderr, "inflate: stored end\n")); |