summaryrefslogtreecommitdiff
path: root/myisam/rt_split.c
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-11-04 18:59:49 +0400
committerunknown <hf@deer.(none)>2003-11-04 18:59:49 +0400
commit0f6eb9654dae4d5c0a62e115f0021893ef6351ec (patch)
tree1797699cfb58133abdfea5c8c888160724fd2235 /myisam/rt_split.c
parentcd5308cd9babecbcd93706ab37a88fa3faea86fa (diff)
downloadmariadb-git-0f6eb9654dae4d5c0a62e115f0021893ef6351ec.tar.gz
Fix for memory overlap in rt_split.c (reported by valgrind)
myisam/rt_split.c: Prevent memcpy if source and destination are same
Diffstat (limited to 'myisam/rt_split.c')
-rw-r--r--myisam/rt_split.c3
1 files changed, 2 insertions, 1 deletions
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);