Kernel: Fix null dereference when execve'ing ELF without PT_TLS header

Fixes #4387.
This commit is contained in:
Andreas Kling 2020-12-11 22:58:42 +01:00
parent 552ba1b0a3
commit 97d789c75b
Notes: sideshowbarker 2024-07-19 00:55:09 +09:00

View File

@ -224,7 +224,7 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve
// Copy of the master TLS region that we will clone for new threads
// FIXME: Handle this in userspace
m_master_tls_region = master_tls_region->make_weak_ptr();
m_master_tls_region = master_tls_region ? master_tls_region->make_weak_ptr() : nullptr;
auto main_program_metadata = main_program_description->metadata();