1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 08:57:35 +00:00

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

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();