authentic: Use memmove as the memory can overlap (if path is > 2B)

Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23787
This commit is contained in:
Jakub Jelen 2020-06-29 19:16:57 +02:00 committed by Frank Morgner
parent 5098cfdb40
commit 05dcde508b
1 changed files with 1 additions and 1 deletions

View File

@ -567,7 +567,7 @@ authentic_set_current_files(struct sc_card *card, struct sc_path *path,
sc_file_free(file);
LOG_FUNC_RETURN(ctx, SC_ERROR_UNKNOWN_DATA_RECEIVED);
}
memcpy(card->cache.current_df->path.value + cur_df_path.len,
memmove(card->cache.current_df->path.value + cur_df_path.len,
card->cache.current_df->path.value,
card->cache.current_df->path.len);
memcpy(card->cache.current_df->path.value, cur_df_path.value, cur_df_path.len);