summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-07-26 07:03:39 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2019-07-26 07:03:39 +0200
commitcf8c2a3c3b2eb05df419ce014b98a71b1e75ad6b (patch)
tree0e9c8d48fda7b7494b5d3b220bc6af64e4f3e64a /sql/sql_plugin.cc
parentfc77a66c7eb1b8e90753814aa567daeaabd0dd90 (diff)
parent584d213235704113cf0d70319c0521d93b8744c6 (diff)
downloadmariadb-git-cf8c2a3c3b2eb05df419ce014b98a71b1e75ad6b.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 19c0f508939..44b2a8220b3 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -748,9 +748,9 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
This is done to ensure that only approved libraries from the
plugin directory are used (to make this even remotely secure).
*/
- if (check_valid_path(dl->str, dl->length) ||
- check_string_char_length((LEX_STRING *) dl, 0, NAME_CHAR_LEN,
+ if (check_string_char_length((LEX_STRING *) dl, 0, NAME_CHAR_LEN,
system_charset_info, 1) ||
+ check_valid_path(dl->str, dl->length) ||
plugin_dir_len + dl->length + 1 >= FN_REFLEN)
{
report_error(report, ER_UDF_NO_PATHS);
@@ -1826,6 +1826,9 @@ static void plugin_load(MEM_ROOT *tmp_root)
LEX_STRING name= {(char *)str_name.ptr(), str_name.length()};
LEX_STRING dl= {(char *)str_dl.ptr(), str_dl.length()};
+ if (!name.length || !dl.length)
+ continue;
+
/*
there're no other threads running yet, so we don't need a mutex.
but plugin_add() before is designed to work in multi-threaded