From 4ec442527247b5b534e302e3936491ad18337dbb Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Tue, 16 Jul 2019 15:23:42 -0500 Subject: [PATCH] Fixed overlapping memcpy in emubd Found by DanielLyubin --- emubd/lfs_emubd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emubd/lfs_emubd.c b/emubd/lfs_emubd.c index 712fcba..8c2c30b 100644 --- a/emubd/lfs_emubd.c +++ b/emubd/lfs_emubd.c @@ -215,7 +215,7 @@ int lfs_emubd_prog(const struct lfs_config *cfg, lfs_block_t block, // update history and stats if (block != emu->history.blocks[0]) { - memcpy(&emu->history.blocks[1], &emu->history.blocks[0], + memmove(&emu->history.blocks[1], &emu->history.blocks[0], sizeof(emu->history) - sizeof(emu->history.blocks[0])); emu->history.blocks[0] = block; }