1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

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.
This commit is contained in:
Andreas Kling 2020-12-23 20:34:22 +01:00
parent c6a0694f50
commit 1e21d49e86

View file

@ -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;