summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2013-06-14 16:38:27 +0200
committerTor Didriksen <tor.didriksen@oracle.com>2013-06-14 16:38:27 +0200
commit45f739bd9d4a98545ca2d7df7f13923e2d31faaa (patch)
treeb8d4007924e7adfcaf400fe6726763ad8e386dc4 /sql
parentc94ccb237e5f8b0f72c742746aa49f8ff8440f98 (diff)
downloadmariadb-git-45f739bd9d4a98545ca2d7df7f13923e2d31faaa.tar.gz
Bug#14834378 ADDRESSSANITIZER BUG IN FILENAME_TO_TABLENAME
Backport to 5.5 sql/sql_table.cc: gcc asan crashes in filename_to_tablename() on this: memcmp("-@", "#sql", 4) during loading of the innobase plugin
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_table.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index cb03411b9ef..c31ba5bb259 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -378,7 +378,8 @@ uint filename_to_tablename(const char *from, char *to, uint to_length
DBUG_ENTER("filename_to_tablename");
DBUG_PRINT("enter", ("from '%s'", from));
- if (!memcmp(from, tmp_file_prefix, tmp_file_prefix_length))
+ if (strlen(from) >= tmp_file_prefix_length &&
+ !memcmp(from, tmp_file_prefix, tmp_file_prefix_length))
{
/* Temporary table name. */
res= (strnmov(to, from, to_length) - to);