summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorAditya A <aditya.a@oracle.com>2018-09-10 16:00:29 +0530
committerSergei Golubchik <serg@mariadb.org>2019-01-23 12:39:17 +0100
commit6de2928d5bf912ace5fb5a1e2254025efe202b67 (patch)
tree8d97406553c456eec9191a4ab4e0dce38dd56a3c /sql/sql_repl.cc
parent942a6bd0090eff5680e4465040abc2b75f77e033 (diff)
downloadmariadb-git-6de2928d5bf912ace5fb5a1e2254025efe202b67.tar.gz
Bug #28178776 COMPARISON OF UNINITAILIZED MEMORY IN LOG_IN_USE
PROBLEM ------- Memory sanitizer reports uninitialized comparisons in log_in_use(), because strings are compared with memcmp() instead of strncmp. FIX --- Use strncmp() to compare strings
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index ca6e8d15e7a..cb4904bb5a6 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
- Copyright (c) 2008, 2017, MariaDB Corporation
+/* Copyright (c) 2000, 2018, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2019, MariaDB Corporation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -365,7 +365,7 @@ bool log_in_use(const char* log_name)
if ((linfo = tmp->current_linfo))
{
mysql_mutex_lock(&linfo->lock);
- result = !memcmp(log_name, linfo->log_file_name, log_name_len);
+ result = !strncmp(log_name, linfo->log_file_name, log_name_len);
mysql_mutex_unlock(&linfo->lock);
if (result)
break;