Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions api/ruxos_posix_api/src/imp/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ pub fn sys_pread64(
) -> ctypes::ssize_t {
syscall_body!(sys_pread64, {
debug!("sys_pread64 <= {fd} {count} {pos}");
if pos < 0 {
return Err(LinuxError::EINVAL);
}
if buf.is_null() {
return Err(LinuxError::EFAULT);
}
Expand All @@ -93,6 +96,9 @@ pub fn sys_pwrite64(
) -> ctypes::ssize_t {
syscall_body!(sys_pwrite64, {
debug!("sys_pwrite64 <= {fd} {count} {pos}");
if pos < 0 {
return Err(LinuxError::EINVAL);
}
if buf.is_null() {
return Err(LinuxError::EFAULT);
}
Expand Down
Loading