summaryrefslogtreecommitdiff
path: root/storage/perfschema
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-08-28 15:23:21 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-08-28 15:23:21 +0300
commit5f35e103ee667b8596efbd138819af8dedd93ed5 (patch)
treec01e53829e93076958e2c5f625b5bc34f33c12b3 /storage/perfschema
parent9cd6e7ad73554be6d0186a42f983777a90a984f1 (diff)
parent4ba20e0a14b9134a7e71aa4b592522967456317c (diff)
downloadmariadb-git-5f35e103ee667b8596efbd138819af8dedd93ed5.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'storage/perfschema')
-rw-r--r--storage/perfschema/pfs_instr.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc
index 28e9dfa9fc2..d52af3e80df 100644
--- a/storage/perfschema/pfs_instr.cc
+++ b/storage/perfschema/pfs_instr.cc
@@ -1265,7 +1265,6 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass,
char dirbuffer[FN_REFLEN];
size_t dirlen;
const char *normalized_filename;
- int normalized_length;
dirlen= dirname_length(safe_filename);
if (dirlen == 0)
@@ -1296,7 +1295,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass,
*buf_end= '\0';
normalized_filename= buffer;
- normalized_length= strlen(normalized_filename);
+ size_t normalized_length= strlen(normalized_filename);
PFS_file **entry;
uint retry_count= 0;
@@ -1345,7 +1344,7 @@ search:
pfs->m_class= klass;
pfs->m_enabled= klass->m_enabled && flag_global_instrumentation;
pfs->m_timed= klass->m_timed;
- strncpy(pfs->m_filename, normalized_filename, normalized_length);
+ strncpy(pfs->m_filename, normalized_filename, normalized_length + 1);
pfs->m_filename[normalized_length]= '\0';
pfs->m_filename_length= normalized_length;
pfs->m_file_stat.m_open_count= 1;