diff options
author | Eugene Kosov <claprix@yandex.ru> | 2021-03-25 15:17:36 +0300 |
---|---|---|
committer | Eugene Kosov <claprix@yandex.ru> | 2021-03-26 01:04:28 +0300 |
commit | e9e1890162c2f75e399229f08dd9924d55d9655b (patch) | |
tree | 56b566a24c5eb1724f45b4ac93839e8478171813 | |
parent | b5cea823d7b9c8ecbb87cad8b2d9c35677885a16 (diff) | |
download | mariadb-git-e9e1890162c2f75e399229f08dd9924d55d9655b.tar.gz |
MDEV-25223 follow-up: do not create an iterator from nullptr
-rw-r--r-- | storage/innobase/fil/fil0crypt.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 5810fff94f2..3243a16c33d 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,12 @@ 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 { |