Skip to content

Commit

Permalink
ASAN error in is_stat_table()
Browse files Browse the repository at this point in the history
don't memcmp beyond the first argument's end

Also:
  use my_strcasecmp(table_alias_charset), like elsewhere, not memcmp
  • Loading branch information
vuvova committed May 5, 2018
1 parent 9989c26 commit f214d36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sql/sql_statistics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3990,11 +3990,11 @@ bool is_stat_table(const char *db, const char *table)
{
DBUG_ASSERT(db && table);

if (!memcmp(db, stat_tables_db_name.str, stat_tables_db_name.length))
if (!my_strcasecmp(table_alias_charset, db, stat_tables_db_name.str))
{
for (uint i= 0; i < STATISTICS_TABLES; i ++)
{
if (!memcmp(table, stat_table_name[i].str, stat_table_name[i].length))
if (!my_strcasecmp(table_alias_charset, table, stat_table_name[i].str))
return true;
}
}
Expand Down

0 comments on commit f214d36

Please sign in to comment.