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 ccb6cd8053 (MDEV-35189).

Reviewed by: Debarun Banerjee
This commit is contained in:
Marko Mäkelä 2024-11-25 10:31:57 +02:00
parent ec58fce3da
commit 2255be0395

View file

@ -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<void*>(node->data), data, data_len);
*after= node;
return node->data;