diff options
author | Andreas Kling <kling@serenityos.org> | 2020-12-11 22:58:42 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-11 22:59:46 +0100 |
commit | 97d789c75b1f8be3da33e267dec990bb3a47073b (patch) | |
tree | 55b48e38e3dbb2f65872b7474069aea15b98baae /Kernel | |
parent | 552ba1b0a3793f5abc02a4eec347a9f78d5b9592 (diff) | |
download | serenity-97d789c75b1f8be3da33e267dec990bb3a47073b.zip |
Kernel: Fix null dereference when execve'ing ELF without PT_TLS header
Fixes #4387.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Syscalls/execve.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp index a1c16ab84e..8d2b5af041 100644 --- a/Kernel/Syscalls/execve.cpp +++ b/Kernel/Syscalls/execve.cpp @@ -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(); |