From f7f0afe03ebec007fda4e85100a8ca71a78ef831 Mon Sep 17 00:00:00 2001 From: SeliverWang <568073531@qq.com> Date: Sun, 25 Aug 2024 10:18:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DTLS=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=86=85=E5=AD=98=E5=90=8E=E6=B2=A1=E6=9C=89=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/posix/pthreads/pthread_tls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/libc/posix/pthreads/pthread_tls.c b/components/libc/posix/pthreads/pthread_tls.c index 2e709acb60..dc23cb763c 100644 --- a/components/libc/posix/pthreads/pthread_tls.c +++ b/components/libc/posix/pthreads/pthread_tls.c @@ -55,6 +55,8 @@ int pthread_setspecific(pthread_key_t key, const void *value) if (ptd->tls == NULL) { ptd->tls = (void**)rt_malloc(sizeof(void*) * PTHREAD_KEY_MAX); + + rt_memset(ptd->tls, 0, sizeof(void*) * PTHREAD_KEY_MAX); } if ((key < PTHREAD_KEY_MAX) && _thread_keys[key].is_used)