1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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
This commit is contained in:
Tor Didriksen
2013-06-14 16:38:27 +02:00
parent c94ccb237e
commit 45f739bd9d
2 changed files with 5 additions and 2 deletions

View File

@@ -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);