From 3b14ab95d35f356659394d4ed5300e72c8f5418d Mon Sep 17 00:00:00 2001 From: marko <> Date: Wed, 20 Sep 2006 11:14:54 +0000 Subject: [PATCH] branches/zip: fil_create_new_single_table_tablespace(): Make page_zip->data point to an address different from page, to avoid calling memcpy() with overlapping source and destination. --- fil/fil0fil.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fil/fil0fil.c b/fil/fil0fil.c index b11d98cd5ce..66bd41738c4 100644 --- a/fil/fil0fil.c +++ b/fil/fil0fil.c @@ -2607,7 +2607,7 @@ fil_create_new_single_table_tablespace( return(DB_ERROR); } - buf2 = ut_malloc(2 * UNIV_PAGE_SIZE); + buf2 = ut_malloc(2 * UNIV_PAGE_SIZE + zip_size); /* Align the memory for file i/o if we might have O_DIRECT set */ page = ut_align(buf2, UNIV_PAGE_SIZE); @@ -2658,7 +2658,8 @@ error_exit2: } else { page_zip_des_t page_zip; page_zip.size = zip_size; - page_zip.data = page; + page_zip.data = page + UNIV_PAGE_SIZE; + memset(page_zip.data, 0, zip_size); page_zip.n_blobs = page_zip.m_start = page_zip.m_end = 0; buf_flush_init_for_writing(page, &page_zip, ut_dulint_zero, *space_id, 0);