Commit fee11c77 authored by Marko Mäkelä's avatar Marko Mäkelä

Make page validation stricter

page_simple_validate_old(), page_simple_validate_new():
Require PAGE_N_DIR_SLOTS to be at least 2.
parent 38b4c078
...@@ -2020,10 +2020,9 @@ page_simple_validate_old( ...@@ -2020,10 +2020,9 @@ page_simple_validate_old(
n_slots = page_dir_get_n_slots(page); n_slots = page_dir_get_n_slots(page);
if (UNIV_UNLIKELY(n_slots > UNIV_PAGE_SIZE / 4)) { if (UNIV_UNLIKELY(n_slots < 2 || n_slots > UNIV_PAGE_SIZE / 4)) {
ib::error() << "Nonsensical number " << n_slots ib::error() << "Nonsensical number of page dir slots: "
<< " of page dir slots"; << n_slots;
goto func_exit; goto func_exit;
} }
...@@ -2220,10 +2219,9 @@ page_simple_validate_new( ...@@ -2220,10 +2219,9 @@ page_simple_validate_new(
n_slots = page_dir_get_n_slots(page); n_slots = page_dir_get_n_slots(page);
if (UNIV_UNLIKELY(n_slots > UNIV_PAGE_SIZE / 4)) { if (UNIV_UNLIKELY(n_slots < 2 || n_slots > srv_page_size / 4)) {
ib::error() << "Nonsensical number " << n_slots ib::error() << "Nonsensical number of page dir slots: "
<< " of page dir slots"; << n_slots;
goto func_exit; goto func_exit;
} }
......
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