diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-07-26 22:42:35 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-07-26 22:42:35 +0200 |
commit | d97342b6f2cfdd55eb0f82b390ebc89c5997c382 (patch) | |
tree | 238dbb11c51a2352c99de198586b84f260b3aad9 /sql/sql_plugin.cc | |
parent | 00a254cc069e77f2088f6fbf8c367f247cfdd0dc (diff) | |
parent | 32c6f40a6319d493e5270c72ac5d27dc99d1b242 (diff) | |
download | mariadb-git-d97342b6f2cfdd55eb0f82b390ebc89c5997c382.tar.gz |
Merge branch '10.2' into 10.3
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r-- | sql/sql_plugin.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index c7515fadbcb..6665da4553f 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -728,9 +728,9 @@ static st_plugin_dl *plugin_dl_add(const LEX_CSTRING *dl, myf MyFlags) 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_CSTRING *) dl, 0, NAME_CHAR_LEN, + if (check_string_char_length((LEX_CSTRING *) dl, 0, NAME_CHAR_LEN, system_charset_info, 1) || + check_valid_path(dl->str, dl->length) || plugin_dir_len + dl->length + 1 >= FN_REFLEN) { my_error(ER_UDF_NO_PATHS, MyFlags); @@ -1841,6 +1841,9 @@ static void plugin_load(MEM_ROOT *tmp_root) LEX_CSTRING name= {str_name.ptr(), str_name.length()}; LEX_CSTRING dl= {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 |