diff options
author | 1999-06-06 19:15:03 +0000 | |
---|---|---|
committer | 1999-06-06 19:15:03 +0000 | |
commit | 3a5af8b8542c94e0761d7e71c3d8f88df6200c6e (patch) | |
tree | 5cafb5a8dd5ba26f15e1e84eaa884dea95aae1e3 | |
parent | permit non-broadcast reply; map@infinitum.ch (diff) | |
download | wireguard-openbsd-3a5af8b8542c94e0761d7e71c3d8f88df6200c6e.tar.xz wireguard-openbsd-3a5af8b8542c94e0761d7e71c3d8f88df6200c6e.zip |
adjtime(2) did not return EFAULT for bad olddelta ptr; darrenr@merlin.reed.wattle.id.au
-rw-r--r-- | lib/libc/sys/adjtime.2 | 4 | ||||
-rw-r--r-- | sys/kern/kern_time.c | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/libc/sys/adjtime.2 b/lib/libc/sys/adjtime.2 index 38723ea205a..03f68525080 100644 --- a/lib/libc/sys/adjtime.2 +++ b/lib/libc/sys/adjtime.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: adjtime.2,v 1.6 1999/05/23 14:10:50 aaron Exp $ +.\" $OpenBSD: adjtime.2,v 1.7 1999/06/06 19:15:04 deraadt Exp $ .\" $NetBSD: adjtime.2,v 1.5 1995/10/12 15:40:44 jtc Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 @@ -93,7 +93,7 @@ case an error code is stored in the global variable will fail if: .Bl -tag -width Er .It Bq Er EFAULT -An argument points outside the process's allocated address space. +Either of the arguments point outside the process's allocated address space. .It Bq Er EPERM The process's effective user ID is not that of the super-user. .El diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index a8eea50fd48..299f0d74a32 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_time.c,v 1.12 1998/02/20 14:51:56 niklas Exp $ */ +/* $OpenBSD: kern_time.c,v 1.13 1999/06/06 19:15:03 deraadt Exp $ */ /* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */ /* @@ -368,8 +368,9 @@ sys_adjtime(p, v, retval) if (SCARG(uap, olddelta)) { atv.tv_sec = odelta / 1000000; atv.tv_usec = odelta % 1000000; - (void)copyout((void *)&atv, (void *)SCARG(uap, olddelta), - sizeof(struct timeval)); + if (error = copyout((void *)&atv, (void *)SCARG(uap, olddelta), + sizeof(struct timeval))) + return (error); } return (0); } |