Commit d3bdc30c authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-22060 MSAN use-of-uninitialized-value in main.query_cache_innodb

During the test main.query_cache_innodb, only 16 bytes of
db_buf are initialized during the memcmp() in
dict_acquire_mdl_shared<false>(), but db_len was wrongly set to 20 bytes.

Something similar was fixed in MDEV-21344, but only for the table name,
in commit 0e25a8b4.

dict_table_t::parse_name(): Assign the return value of
filename_to_tablename() to the output parameters for lengths.
There is no need to invoke strlen().
parent 0181384a
......@@ -753,9 +753,8 @@ bool dict_table_t::parse_name(char (&db_name)[NAME_LEN + 1],
if (!dict_locked)
mutex_exit(&dict_sys.mutex);
*db_name_len= db_len;
filename_to_tablename(db_buf, db_name, MAX_DATABASE_NAME_LEN + 1, true);
*db_name_len= filename_to_tablename(db_buf, db_name,
MAX_DATABASE_NAME_LEN + 1, true);
if (tbl_len > TEMP_FILE_PREFIX_LENGTH
&& !strncmp(tbl_buf, TEMP_FILE_PREFIX, TEMP_FILE_PREFIX_LENGTH))
......@@ -764,8 +763,8 @@ bool dict_table_t::parse_name(char (&db_name)[NAME_LEN + 1],
if (char* is_part= strchr(tbl_buf, '#'))
*is_part= '\0';
filename_to_tablename(tbl_buf, tbl_name, MAX_TABLE_NAME_LEN + 1, true);
*tbl_name_len= strlen(tbl_name);
*tbl_name_len= filename_to_tablename(tbl_buf, tbl_name,
MAX_TABLE_NAME_LEN + 1, true);
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment