diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2021-09-21 19:14:07 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2021-09-21 19:14:07 +0200 |
commit | b4074069b2a89a14d9406f4c10c92811cdd78c79 (patch) | |
tree | 82d5d7ca13d685887f88756a5bb12a943c59fc05 | |
parent | 699de65d5e1cda0b8c6a994f8513e97804b1a7ad (diff) | |
download | mariadb-git-b4074069b2a89a14d9406f4c10c92811cdd78c79.tar.gz |
MDEV-26657 : Initialize some fields in create_background_thd()
Avoid reading uninitialized memory by thd_get_error_context_description().
Note, that THD::real_id can't be initialized at this stage, so it will be zeroed.
-rw-r--r-- | sql/sql_class.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 0d9a8439ccb..883e9c688ff 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -4922,6 +4922,9 @@ MYSQL_THD create_background_thd() thd->set_command(COM_DAEMON); thd->system_thread= SYSTEM_THREAD_GENERIC; thd->security_ctx->host_or_ip= ""; + thd->real_id= 0; + thd->thread_id= 0; + thd->query_id= 0; return thd; } |