Skip to content

Commit ab0266a

Browse files
committed
Avoid use of memcpy() in inflate when areas can overlap.
1 parent ec346f1 commit ab0266a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

inflate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -884,12 +884,12 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
884884
if (copy > have) copy = have;
885885
if (copy > left) copy = left;
886886
if (copy == 0) goto inf_leave;
887-
zmemcpy(put, next, copy);
888887
have -= copy;
889-
next += copy;
890888
left -= copy;
891-
put += copy;
892889
state->length -= copy;
890+
do {
891+
*put++ = *next++;
892+
} while (--copy);
893893
break;
894894
}
895895
Tracev((stderr, "inflate: stored end\n"));

0 commit comments

Comments
 (0)