diff options
Diffstat (limited to 'Libraries/LibC/stdio.cpp')
-rw-r--r-- | Libraries/LibC/stdio.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Libraries/LibC/stdio.cpp b/Libraries/LibC/stdio.cpp index 5f93aba2bb..5a28d90325 100644 --- a/Libraries/LibC/stdio.cpp +++ b/Libraries/LibC/stdio.cpp @@ -510,7 +510,12 @@ int fclose(FILE* stream) int rename(const char* oldpath, const char* newpath) { - int rc = syscall(SC_rename, oldpath, newpath); + if (!oldpath || !newpath) { + errno = EFAULT; + return -1; + } + Syscall::SC_rename_params params { { oldpath, strlen(oldpath) }, { newpath, strlen(newpath) } }; + int rc = syscall(SC_rename, ¶ms); __RETURN_WITH_ERRNO(rc, rc, -1); } |