From 74d03a9b2d881a56eceb9da5875a95f17b7ea0ae Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Thu, 25 Mar 2021 15:17:36 +0300 Subject: MDEV-25223 follow-up: do not create an iterator from nullptr --- storage/innobase/fil/fil0crypt.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 5810fff94f2..2b9180fe5c2 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -1482,7 +1482,7 @@ encryption parameters were changed @param encrypt expected state of innodb_encrypt_tables @return the next tablespace @retval fil_system.temp_space if there is no work to do -@retval nullptr upon reaching the end of the iteration */ +@retval end() upon reaching the end of the iteration */ space_list_t::iterator fil_space_t::next(space_list_t::iterator space, bool recheck, bool encrypt) { @@ -1490,9 +1490,11 @@ space_list_t::iterator fil_space_t::next(space_list_t::iterator space, if (!srv_fil_crypt_rotate_key_age) { - space= space_list_t::iterator(fil_system.keyrotate_next( + fil_space_t *next_space= fil_system.keyrotate_next( space != fil_system.space_list.end() ? &*space : nullptr, recheck, - encrypt)); + encrypt); + space= next_space ? space_list_t::iterator(next_space) + : fil_system.space_list.end(); } else { -- cgit v1.2.1