diff options
author | Adam C. Emerson <aemerson@redhat.com> | 2020-07-07 22:39:57 +0200 |
---|---|---|
committer | Adam C. Emerson <aemerson@redhat.com> | 2020-09-09 04:09:40 +0200 |
commit | 4cec019d5efabb340b9e8541dae58f33a2826c50 (patch) | |
tree | f2eef451cd6184ba48896d67d1b4d8bc28fe84b5 /src/common/Thread.h | |
parent | common/ceph_json: Support en/decoding Boost's flat containers (diff) | |
download | ceph-4cec019d5efabb340b9e8541dae58f33a2826c50.tar.xz ceph-4cec019d5efabb340b9e8541dae58f33a2826c50.zip |
common/Thread: Don't store pointer to thread_name
Having Thread::create store a pointer to a string that is passed to
ceph_pthread_setname in Thread::entry_wrapper can lead to using a
pointer in the calling thread's stack that gets freed before use.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Diffstat (limited to 'src/common/Thread.h')
-rw-r--r-- | src/common/Thread.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/Thread.h b/src/common/Thread.h index 0ab65fca52f..5242fb5f307 100644 --- a/src/common/Thread.h +++ b/src/common/Thread.h @@ -33,7 +33,7 @@ class Thread { pthread_t thread_id; pid_t pid; int cpuid; - const char *thread_name; + std::string thread_name; void *entry_wrapper(); |