blob: 44351b6569ef1a76b2684a8900e963580206a118 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From ab18f04cf89ef4e8521c81c50477e1363b2d333b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 28 Apr 2018 09:46:12 -0700
4Subject: [PATCH] use memmove instead of memcpy on overlapping region
5
6Fixes
7super0.c:526:3: error: 'memcpy' accessing 3936 bytes at offsets 156 and 160 overlaps 3932 bytes at offset 160 [-Werror=restrict]
8
9Upstream-Status: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 super0.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/super0.c b/super0.c
17index f5b4507..264b598 100644
18--- a/super0.c
19+++ b/super0.c
20@@ -523,7 +523,7 @@ static int update_super0(struct supertype *st, struct mdinfo *info,
21 * up 4 bytes before continuing
22 */
23 __u32 *sb32 = (__u32*)sb;
24- memcpy(sb32+MD_SB_GENERIC_CONSTANT_WORDS+7,
25+ memmove(sb32+MD_SB_GENERIC_CONSTANT_WORDS+7,
26 sb32+MD_SB_GENERIC_CONSTANT_WORDS+7+1,
27 (MD_SB_WORDS - (MD_SB_GENERIC_CONSTANT_WORDS+7+1))*4);
28 if (verbose >= 0)
29--
302.17.0
31