diff options
author | Mark Adler <zlib@madler.net> | 2017-10-12 19:34:51 -0700 |
---|---|---|
committer | Mark Adler <zlib@madler.net> | 2017-10-12 19:35:59 -0700 |
commit | b25d5fcdcf4723ca3da8bc69ecc6c52010778f7c (patch) | |
tree | 96ee239a6cf0c96a4332d53ab99517d6b8ec5d5f /gzwrite.c | |
parent | ae49d1472ec176ddc53a3a4905f91d46344386e6 (diff) | |
download | zlib-b25d5fcdcf4723ca3da8bc69ecc6c52010778f7c.tar.gz |
Avoid undefined behaviors of memcpy() in gz*printf().
Diffstat (limited to 'gzwrite.c')
-rw-r--r-- | gzwrite.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -444,7 +444,7 @@ int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) strm->avail_in = state->size; if (gz_comp(state, Z_NO_FLUSH) == -1) return state->err; - memcpy(state->in, state->in + state->size, left); + memmove(state->in, state->in + state->size, left); strm->next_in = state->in; strm->avail_in = left; } @@ -543,7 +543,7 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, strm->avail_in = state->size; if (gz_comp(state, Z_NO_FLUSH) == -1) return state->err; - memcpy(state->in, state->in + state->size, left); + memmove(state->in, state->in + state->size, left); strm->next_in = state->in; strm->avail_in = left; } |