summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeemu Ollakka <teemu.ollakka@galeracluster.com>2020-07-23 14:48:07 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2020-07-24 08:50:15 +0300
commit8ef41c60847be839914b04951852df82c61ae6a2 (patch)
treec10bf9d3fe829332dd6069e3f1e34b50cf11f3f6
parent7d22d666d2f91689e00c4eadc859c523cd9277ba (diff)
downloadmariadb-git-8ef41c60847be839914b04951852df82c61ae6a2.tar.gz
MDEV-23272 Galera stack-use-after-scope error with ASAN build
THD proc info was assigned from stack allocated temporary buffer which went out of scope immediately after assignment. Fixed by removing the use of temp buffer and assign proc info from string literal.
-rw-r--r--storage/innobase/handler/ha_innodb.cc9
-rw-r--r--storage/xtradb/handler/ha_innodb.cc9
2 files changed, 0 insertions, 18 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 9ca8fe86ec6..10098a2fa4d 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -4188,16 +4188,7 @@ innobase_commit_low(
#ifdef WITH_WSREP
const char* tmp = 0;
if (trx->is_wsrep()) {
-#ifdef WSREP_PROC_INFO
- char info[64];
- info[sizeof(info) - 1] = '\0';
- snprintf(info, sizeof(info) - 1,
- "innobase_commit_low():trx_commit_for_mysql(%lld)",
- (long long) wsrep_thd_trx_seqno(trx->mysql_thd));
- tmp = thd_proc_info(trx->mysql_thd, info);
-#else
tmp = thd_proc_info(trx->mysql_thd, "innobase_commit_low()");
-#endif /* WSREP_PROC_INFO */
}
#endif /* WITH_WSREP */
if (trx_is_started(trx)) {
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 1cbe334ef09..bb324faf2b6 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -4678,16 +4678,7 @@ innobase_commit_low(
#ifdef WITH_WSREP
const char* tmp = 0;
if (trx->is_wsrep()) {
-#ifdef WSREP_PROC_INFO
- char info[64];
- info[sizeof(info) - 1] = '\0';
- snprintf(info, sizeof(info) - 1,
- "innobase_commit_low():trx_commit_for_mysql(%lld)",
- (long long) wsrep_thd_trx_seqno(trx->mysql_thd));
- tmp = thd_proc_info(trx->mysql_thd, info);
-#else
tmp = thd_proc_info(trx->mysql_thd, "innobase_commit_low()");
-#endif /* WSREP_PROC_INFO */
}
#endif /* WITH_WSREP */
if (trx_is_started(trx)) {