mirror of
https://github.com/MariaDB/server.git
synced 2025-07-02 14:22:51 +03:00
MDEV-34205: ASAN stack buffer overflow in strxnmov() in frm_file_exists
Correct the second parameter for strxnmov to prevent potential buffer overflows. The second parameter must be one less than the size of the input buffer to avoid writing past the end of the buffer. While the second parameter is usually correct, there are exceptions that need fixing. This commit addresses the issue within frm_file_exists() and other affected places.
This commit is contained in:
@ -1906,7 +1906,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
|
||||
*/
|
||||
build_table_filename(path, sizeof(path) - 1, lpt->alter_info->db.str,
|
||||
lpt->alter_info->table_name.str, "", 0);
|
||||
strxnmov(frm_name, sizeof(frm_name), path, reg_ext, NullS);
|
||||
strxnmov(frm_name, sizeof(frm_name)-1, path, reg_ext, NullS);
|
||||
/*
|
||||
When we are changing to use new frm file we need to ensure that we
|
||||
don't collide with another thread in process to open the frm file.
|
||||
|
Reference in New Issue
Block a user