Commit 7eb084fe authored by Daniel Black's avatar Daniel Black Committed by Vladislav Vaintroub

MariaBackup: gcc7 - snprintf output overflow warning

extra/mariabackup/xtrabackup.cc: In function ‘ulint xb_process_datadir(const char*, const char*, handle_datadir_entry_func_t)’:
extra/mariabackup/xtrabackup.cc:4534:1: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
 xb_process_datadir(
 ^~~~~~~~~~~~~~~~~~
mariabackup/xtrabackup.cc:4607:11: note: ‘snprintf’ output 2 or more bytes (assuming 4001) into a destination of size 4000
   snprintf(dbpath, sizeof(dbpath), "%s/%s", path, dbinfo.name);
   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
parent 464ba0e9
......@@ -4538,7 +4538,7 @@ xb_process_datadir(
handle_datadir_entry_func_t func) /*!<in: callback */
{
ulint ret;
char dbpath[OS_FILE_MAX_PATH];
char dbpath[OS_FILE_MAX_PATH+1];
os_file_dir_t dir;
os_file_dir_t dbdir;
os_file_stat_t dbinfo;
......@@ -4604,7 +4604,7 @@ xb_process_datadir(
goto next_datadir_item;
}
snprintf(dbpath, sizeof(dbpath), "%s/%s", path, dbinfo.name);
snprintf(dbpath, sizeof(dbpath)-1, "%s/%s", path, dbinfo.name);
os_normalize_path(dbpath);
......
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