summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_filedesc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_filedesc.c b/sys/kern/kern_filedesc.c
index 6cdc1ee..e4fe2f6 100644
--- a/sys/kern/kern_filedesc.c
+++ b/sys/kern/kern_filedesc.c
@@ -78,7 +78,9 @@ make_write_buf(struct proc *td, const void *data, char **buf_out, size_t count)
* A user process called us, so we want to be careful
* and use copyin()
*/
- copyin((uintptr_t)data, buf, count);
+ if (copyin((uintptr_t)data, buf, count) != 0) {
+ invalid_uaddr(data);
+ }
} else {
/* Can just memcpy() here */
memcpy(buf, (char *)data, count);