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

Kernel/Syscalls: Use copy_n_to_user when applicable

copy_to_user() with bytes as the last argument could be changed to using
copy_n_to_user() with a count.
This commit is contained in:
Pankaj Raghav 2023-03-24 09:59:28 +01:00 committed by Andreas Kling
parent f32fde6152
commit d0ac24ddbf
5 changed files with 10 additions and 9 deletions

View file

@ -131,7 +131,7 @@ ErrorOr<FlatPtr> Process::sys$poll(Userspace<Syscall::SC_poll_params const*> use
}
if (params.nfds > 0)
TRY(copy_to_user(&params.fds[0], fds_copy.data(), params.nfds * sizeof(pollfd)));
TRY(copy_n_to_user(&params.fds[0], fds_copy.data(), params.nfds));
return fds_with_revents;
}