summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-23 20:34:22 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-23 20:34:22 +0100
commit1e21d49e8606eae91eab127ccee4e152807687eb (patch)
tree398733cf5bece6843fa2ebc0cc99d9f59c4fbae5 /Kernel
parentc6a0694f50f239dd1f3f4ab6cc876a160a66f90f (diff)
downloadserenity-1e21d49e8606eae91eab127ccee4e152807687eb.zip
Kernel: Fix wrong-looking overflow check in sys$execve()
This was harmless since sizeof(length) and sizeof(strings) are both 4 on x86 but let's check the right things regardless.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Syscalls/execve.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp
index 7b4a387b2b..e6f5e929b0 100644
--- a/Kernel/Syscalls/execve.cpp
+++ b/Kernel/Syscalls/execve.cpp
@@ -644,7 +644,7 @@ int Process::sys$execve(Userspace<const Syscall::SC_execve_params*> user_params)
auto copy_user_strings = [](const auto& list, auto& output) {
if (!list.length)
return true;
- Checked size = sizeof(list.length);
+ Checked size = sizeof(list.strings);
size *= list.length;
if (size.has_overflow())
return false;