From d488239a2eb3663dd3ec9fc8a0a2b752a69e04b5 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Sat, 15 Mar 2025 11:08:32 +0000 Subject: [PATCH] [MPS] Clear a new thread's pdl, avoiding crashes (bug#77024) * src/thread.c (Fmake_thread): Use 'xzalloc', not 'xmalloc', to allocate new specpdl. --- src/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thread.c b/src/thread.c index ee93a7a8644..00876ff3392 100644 --- a/src/thread.c +++ b/src/thread.c @@ -904,7 +904,7 @@ If NAME is given, it must be a string; it names the new thread. */) new_thread->m_current_buffer = current_thread->m_current_buffer; ptrdiff_t size = 50; - union specbinding *pdlvec = xmalloc ((1 + size) * sizeof (union specbinding)); + union specbinding *pdlvec = xzalloc ((1 + size) * sizeof (union specbinding)); new_thread->m_specpdl = pdlvec + 1; /* Skip the dummy entry. */ new_thread->m_specpdl_end = new_thread->m_specpdl + size; new_thread->m_specpdl_ptr = new_thread->m_specpdl;