소스 검색

Fixed overlapping memcpy in emubd

Found by DanielLyubin
Christopher Haster 6 년 전
부모
커밋
4ec4425272
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      emubd/lfs_emubd.c

+ 1 - 1
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;
     }