diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-06-23 14:48:29 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-06-24 10:03:23 +0200 |
commit | 5feb60ce186a41ba97f4c9dc4ab23bab4e87296e (patch) | |
tree | 2b2683d044c62b5bec1fb6302b43a822d5bce60b /mysys | |
parent | 3e09c6199dc4c74ee628cf01486927e4d3261887 (diff) | |
download | mariadb-git-5feb60ce186a41ba97f4c9dc4ab23bab4e87296e.tar.gz |
MDEV-22590 SIGSEGV in flush_all_key_blocks when changing key_buffer_size / ASAN: heap-use-after-free in flush_all_key_blocks
Take into account that in preparation of a simple key cache for resizing no disk blocks might be assigned to it.
Reviewer: IgorBabaev <igor@mariadb.com>
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/mf_keycache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 8f62869b57e..8aa60064e06 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -701,7 +701,7 @@ int prepare_resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, keycache->in_resize= 1; /* Need to flush only if keycache is enabled. */ - if (keycache->can_be_used) + if (keycache->can_be_used && keycache->disk_blocks != -1) { /* Start the flush phase. */ keycache->resize_in_flush= 1; |