From cdedcc7943114bbbcbc2be1a0ef5716b0ef2e862 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 14 Nov 2002 00:48:38 +0000 Subject: * sysdeps/generic/dl-tls.c (_dl_allocate_tls_storage): Zero the space for the new TCB. --- sysdeps/generic/dl-tls.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysdeps/generic') diff --git a/sysdeps/generic/dl-tls.c b/sysdeps/generic/dl-tls.c index 2c68a251b6..014c3a4809 100644 --- a/sysdeps/generic/dl-tls.c +++ b/sysdeps/generic/dl-tls.c @@ -262,6 +262,10 @@ _dl_allocate_tls_storage (void) result = (char *) result + GL(dl_tls_static_size) - TLS_TCB_SIZE; # endif + /* Clear the TCB data structure. We can't ask the caller (i.e. + libpthread) to do it, because we will initialize the DTV et al. */ + memset (result, 0, TLS_TCB_SIZE); + result = allocate_dtv (result); if (result == NULL) free (allocated); -- cgit 1.4.1