From 1e21d49e8606eae91eab127ccee4e152807687eb Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 23 Dec 2020 20:34:22 +0100 Subject: [PATCH] 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. --- Kernel/Syscalls/execve.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp index 7b4a387b2b1..e6f5e929b0c 100644 --- a/Kernel/Syscalls/execve.cpp +++ b/Kernel/Syscalls/execve.cpp @@ -644,7 +644,7 @@ int Process::sys$execve(Userspace 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;