use memmove for copying buffer leftovers, as the ranges may overlap

issue cought by fortify
cute-signatures
Timo Teräs 2015-04-08 16:58:20 +03:00
parent 29bb67e01e
commit 60dd5798c9
1 changed files with 1 additions and 1 deletions

View File

@ -224,7 +224,7 @@ static apk_blob_t is_bs_read(void *stream, apk_blob_t token)
/* We need more data */
if (isbs->left.len != 0)
memcpy(isbs->buffer, isbs->left.ptr, isbs->left.len);
memmove(isbs->buffer, isbs->left.ptr, isbs->left.len);
isbs->left.ptr = isbs->buffer;
size = isbs->is->read(isbs->is, isbs->buffer + isbs->left.len,
sizeof(isbs->buffer) - isbs->left.len);