mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 15:08:12 +00:00
Kernel: Fix wrong sizeof() type in sys$execve() argument overflow check
This commit is contained in:
parent
34a83aba71
commit
ffdfbf1dba
1 changed files with 2 additions and 2 deletions
|
@ -885,13 +885,13 @@ 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.strings);
|
||||
Checked size = sizeof(*list.strings);
|
||||
size *= list.length;
|
||||
if (size.has_overflow())
|
||||
return false;
|
||||
Vector<Syscall::StringArgument, 32> strings;
|
||||
strings.resize(list.length);
|
||||
if (!copy_from_user(strings.data(), list.strings, list.length * sizeof(Syscall::StringArgument)))
|
||||
if (!copy_from_user(strings.data(), list.strings, list.length * sizeof(*list.strings)))
|
||||
return false;
|
||||
for (size_t i = 0; i < list.length; ++i) {
|
||||
auto string = copy_string_from_user(strings[i]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue