Skip to content

Commit

Permalink
MDEV-35472 Server crash in ha_storage_put_memlim upon reading from IN…
Browse files Browse the repository at this point in the history
…NODB_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 ccb6cd8 (MDEV-35189).

Reviewed by: Debarun Banerjee
  • Loading branch information
dr-m committed Nov 25, 2024
1 parent ec58fce commit 2255be0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions storage/innobase/ha/ha0storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2255be0

Please sign in to comment.