diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-15 19:26:20 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-15 19:41:01 +0300 |
commit | fee11c7727d32351c80174e4e85d700f26984c42 (patch) | |
tree | ccb3b8051d8134051c675d248ae9b40d6d755ab1 | |
parent | 38b4c078333205db1381fac66fe9ba7111a3f216 (diff) | |
download | mariadb-git-fee11c7727d32351c80174e4e85d700f26984c42.tar.gz |
Make page validation stricter
page_simple_validate_old(), page_simple_validate_new():
Require PAGE_N_DIR_SLOTS to be at least 2.
-rw-r--r-- | storage/innobase/page/page0page.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc index db33d13db1c..93da608b205 100644 --- a/storage/innobase/page/page0page.cc +++ b/storage/innobase/page/page0page.cc @@ -2020,10 +2020,9 @@ page_simple_validate_old( n_slots = page_dir_get_n_slots(page); - if (UNIV_UNLIKELY(n_slots > UNIV_PAGE_SIZE / 4)) { - ib::error() << "Nonsensical number " << n_slots - << " of page dir slots"; - + if (UNIV_UNLIKELY(n_slots < 2 || n_slots > UNIV_PAGE_SIZE / 4)) { + ib::error() << "Nonsensical number of page dir slots: " + << n_slots; goto func_exit; } @@ -2220,10 +2219,9 @@ page_simple_validate_new( n_slots = page_dir_get_n_slots(page); - if (UNIV_UNLIKELY(n_slots > UNIV_PAGE_SIZE / 4)) { - ib::error() << "Nonsensical number " << n_slots - << " of page dir slots"; - + if (UNIV_UNLIKELY(n_slots < 2 || n_slots > srv_page_size / 4)) { + ib::error() << "Nonsensical number of page dir slots: " + << n_slots; goto func_exit; } |