[MPS] Clear a new thread's pdl, avoiding crashes (bug#77024)

* src/thread.c (Fmake_thread): Use 'xzalloc', not 'xmalloc', to
allocate new specpdl.
This commit is contained in:
Pip Cet 2025-03-15 11:08:32 +00:00
parent dfe1a69abd
commit d488239a2e

View file

@ -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;