From 4cec019d5efabb340b9e8541dae58f33a2826c50 Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Tue, 7 Jul 2020 16:39:57 -0400 Subject: 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 --- src/common/Thread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/Thread.h') 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(); -- cgit v1.2.3