From 0f6eb9654dae4d5c0a62e115f0021893ef6351ec Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Nov 2003 18:59:49 +0400 Subject: Fix for memory overlap in rt_split.c (reported by valgrind) myisam/rt_split.c: Prevent memcpy if source and destination are same --- myisam/rt_split.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'myisam/rt_split.c') diff --git a/myisam/rt_split.c b/myisam/rt_split.c index 41d6f8f8ccd..62b8ea6a65b 100644 --- a/myisam/rt_split.c +++ b/myisam/rt_split.c @@ -326,7 +326,8 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, cur2 = rt_PAGE_NEXT_KEY(cur2, key_length, nod_flag); ++n2; } - memcpy(to - nod_flag, cur->key - nod_flag, full_length); + if (to != cur->key) + memcpy(to - nod_flag, cur->key - nod_flag, full_length); } mi_putint(page, 2 + n1 * full_length, nod_flag); -- cgit v1.2.1