summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 18f848f3cd3..ee94f2d7d07 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -374,7 +374,8 @@ bool check_valid_path(const char *path, size_t len)
static void fix_dl_name(MEM_ROOT *root, LEX_CSTRING *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);