From 2255be03952e0be7db764613956c5c66a6c1ab75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 25 Nov 2024 10:31:57 +0200 Subject: [PATCH] MDEV-35472 Server crash in ha_storage_put_memlim upon reading from INNODB_LOCKS ha_storage_put_memlim(): Initialize node->next in order to avoid a crash on a subsequent invocation, due to dereferencing an uninitialized pointer. This fixes a regression that had been introduced in commit ccb6cd8053ace40d203d435941c6b609d7818cf5 (MDEV-35189). Reviewed by: Debarun Banerjee --- storage/innobase/ha/ha0storage.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/innobase/ha/ha0storage.cc b/storage/innobase/ha/ha0storage.cc index 4a99d5f6e69..ef7cc78a4dd 100644 --- a/storage/innobase/ha/ha0storage.cc +++ b/storage/innobase/ha/ha0storage.cc @@ -67,6 +67,7 @@ ha_storage_put_memlim( (mem_heap_alloc(storage->heap, sizeof *node + data_len)); node->data_len= data_len; node->data= &node[1]; + node->next= nullptr; memcpy(const_cast(node->data), data, data_len); *after= node; return node->data;