summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-04-23 18:14:15 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-04-24 09:19:34 +0300
commit5b79303b40e31d77f616c2b797f58de41973e6a3 (patch)
tree90ef0d2f4c2df05948e0b1db415670f95cd250f5 /extra
parent82d4f081861b227e35299f4ea2e24f55b7146fd1 (diff)
downloadmariadb-git-5b79303b40e31d77f616c2b797f58de41973e6a3.tar.gz
MDEV-15988 Crash in ./mtr mariabackup.undo_space_id
xb_assign_undo_space_start(): Correctly pass the length of the buffer, so that the file name will not be truncated.
Diffstat (limited to 'extra')
-rw-r--r--extra/mariabackup/xtrabackup.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index c4d385fef5e..867e7869fcf 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -3107,8 +3107,8 @@ static dberr_t xb_assign_undo_space_start()
name[dirnamelen++] = SRV_PATH_SEPARATOR;
}
- ut_snprintf(name + dirnamelen, strlen(name) + strlen("ibdata1"),
- "%s", "ibdata1");
+ ut_snprintf(name + dirnamelen, (sizeof name) - dirnamelen,
+ "%s", "ibdata1");
file = os_file_create(innodb_file_data_key, name, OS_FILE_OPEN,
OS_FILE_NORMAL, OS_DATA_FILE, &ret, 0);