Commit 97a03baf authored by marko's avatar marko

branches/zip: page_zip_decompress(): Note that the uncompressed page

may contain uninitialized bytes when the space of a deleted record
is reused by a shorter record.
parent 51d51871
...@@ -2505,9 +2505,15 @@ page_zip_decompress( ...@@ -2505,9 +2505,15 @@ page_zip_decompress(
recs = mem_heap_alloc(heap, n_dense * (2 * sizeof *recs)); recs = mem_heap_alloc(heap, n_dense * (2 * sizeof *recs));
#ifdef UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
/* Clear the page. */ /* Clear the page. The fill byte used to be 0x55, but we use
memset(page, 0x55, UNIV_PAGE_SIZE); 0 from now on in order to mask a known discrepancy: When a
record is freed (i.e., delete-marked and deleted), a shorter
record is allocated from the space, and the page is
compressed, the unused bytes after the shorter record will not
be initialized by the decompressor. */
memset(page, 0, UNIV_PAGE_SIZE);
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
/* To avoid bogus warnings, use UNIV_MEM_VALID instead. See above. */
UNIV_MEM_INVALID(page, UNIV_PAGE_SIZE); UNIV_MEM_INVALID(page, UNIV_PAGE_SIZE);
/* Copy the page header. */ /* Copy the page header. */
memcpy(page, page_zip->data, PAGE_DATA); memcpy(page, page_zip->data, PAGE_DATA);
......
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