1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-26323 use-after-poison issue of MariaDB server

This commit is contained in:
Alexander Barkov
2022-04-14 16:11:04 +04:00
parent 66832e3a64
commit c05fd70097
3 changed files with 28 additions and 1 deletions

View File

@ -372,7 +372,8 @@ bool check_valid_path(const char *path, size_t len)
static void fix_dl_name(MEM_ROOT *root, LEX_STRING *dl)
{
const size_t so_ext_len= sizeof(SO_EXT) - 1;
if (my_strcasecmp(&my_charset_latin1, dl->str + dl->length - so_ext_len,
if (dl->length < so_ext_len ||
my_strcasecmp(&my_charset_latin1, dl->str + dl->length - so_ext_len,
SO_EXT))
{
char *s= (char*)alloc_root(root, dl->length + so_ext_len + 1);