Skip to content

MDEV-35516 sp_lex_keeper use after free - #5527

Open
grooverdan wants to merge 1 commit into
MariaDB:11.4from
grooverdan:MDEV-35516
Open

MDEV-35516 sp_lex_keeper use after free#5527
grooverdan wants to merge 1 commit into
MariaDB:11.4from
grooverdan:MDEV-35516

Conversation

@grooverdan

Copy link
Copy Markdown
Member

MSAN reported that there is a use after destruction. This is obvious in ~sp_lex_instr where the explict destructor is called, followed by the implict call to an already freed memory.

Change ~sp_lex_keeper() to a destroy() method
freeing the contents of object. Make the destructor call destroy(). There is a flag set so no duplicate freeing occurs.

With this in place, ~sp_lex_instr() can call destroy, and leave the implict cleanup of the object to the ~sp_lex_keeper destructor.

MSAN reported that there is a use after destruction.
This is obvious in ~sp_lex_instr where the explict
destructor is called, followed by the implict call
to an already freed memory.

Change ~sp_lex_keeper() to a destroy() method
freeing the contents of object. Make the destructor
call destroy(). There is a flag set so no duplicate
freeing occurs.

With this in place, ~sp_lex_instr() can call destroy,
and leave the implict cleanup of the object to the
~sp_lex_keeper destructor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant