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

Kernel: Use Userspace<T> in sys$getcwd() and sys$chdir()

Add more validation helper overloads as we go. :^)
This commit is contained in:
Andreas Kling 2020-07-31 16:34:47 +02:00
parent 314dbc10d4
commit 62a4099581
3 changed files with 16 additions and 4 deletions

View file

@ -31,7 +31,7 @@
namespace Kernel {
int Process::sys$chdir(const char* user_path, size_t path_length)
int Process::sys$chdir(Userspace<const char*> user_path, size_t path_length)
{
REQUIRE_PROMISE(rpath);
auto path = get_syscall_path_argument(user_path, path_length);
@ -61,7 +61,7 @@ int Process::sys$fchdir(int fd)
return 0;
}
int Process::sys$getcwd(char* buffer, ssize_t size)
int Process::sys$getcwd(Userspace<char*> buffer, ssize_t size)
{
REQUIRE_PROMISE(rpath);
if (size < 0)