diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-06 11:32:25 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-06 11:32:25 +0100 |
commit | 7c916b9fe9ce5ac68b8a63e36f1682951e10da9d (patch) | |
tree | 2e57a77cdf79c3bafaa4b7d124cbe4fc41a18f94 /Libraries/LibC/stdlib.cpp | |
parent | d6b06fd5a31ef6489895690f5fc4e0df113ea01e (diff) | |
download | serenity-7c916b9fe9ce5ac68b8a63e36f1682951e10da9d.zip |
Kernel: Make realpath() take path+length, get rid of SmapDisabler
Diffstat (limited to 'Libraries/LibC/stdlib.cpp')
-rw-r--r-- | Libraries/LibC/stdlib.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Libraries/LibC/stdlib.cpp b/Libraries/LibC/stdlib.cpp index f8e3477ec4..bfac7194dd 100644 --- a/Libraries/LibC/stdlib.cpp +++ b/Libraries/LibC/stdlib.cpp @@ -704,10 +704,15 @@ uint32_t arc4random_uniform(uint32_t max_bounds) char* realpath(const char* pathname, char* buffer) { + if (!pathname) { + errno = EFAULT; + return nullptr; + } size_t size = PATH_MAX; if (buffer == nullptr) buffer = (char*)malloc(size); - int rc = syscall(SC_realpath, pathname, buffer, size); + Syscall::SC_realpath_params params { pathname, strlen(pathname), buffer, size }; + int rc = syscall(SC_realpath, ¶ms); if (rc < 0) { errno = -rc; return nullptr; |