mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 03:17:20 +02:00
Fix segfault in find_files if db is NULL and path does not exist or can't be read
In this case, one would end up calling my_error(ER_BAD_DB_ERROR, ...) with a null ptr for DB, which caused a NULL ptr dereference.
This commit is contained in:
parent
38fe266ea9
commit
324d8a6036
1 changed files with 1 additions and 1 deletions
|
|
@ -943,7 +943,7 @@ find_files(THD *thd, Dynamic_array<LEX_CSTRING*> *files, LEX_CSTRING *db,
|
|||
|
||||
if (!(dirp = my_dir(path, MY_THREAD_SPECIFIC | (db ? 0 : MY_WANT_STAT))))
|
||||
{
|
||||
if (my_errno == ENOENT)
|
||||
if (my_errno == ENOENT && db)
|
||||
my_error(ER_BAD_DB_ERROR, MYF(0), db->str);
|
||||
else
|
||||
my_error(ER_CANT_READ_DIR, MYF(0), path, my_errno);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue