Commit 0f6eb965 authored by unknown's avatar unknown

Fix for memory overlap in rt_split.c (reported by valgrind)


myisam/rt_split.c:
  Prevent memcpy if source and destination are same
parent cd5308cd
...@@ -326,7 +326,8 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, ...@@ -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); cur2 = rt_PAGE_NEXT_KEY(cur2, key_length, nod_flag);
++n2; ++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); mi_putint(page, 2 + n1 * full_length, nod_flag);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment