diff options
author | Thomas Nordin <nordin@cvs.openbsd.org> | 2002-10-02 17:43:39 +0000 |
---|---|---|
committer | Thomas Nordin <nordin@cvs.openbsd.org> | 2002-10-02 17:43:39 +0000 |
commit | e4b46ca06664ba72c6696c5d8adb98bee0a8cef6 (patch) | |
tree | 79442689cc1b533f4d73615478478594ec018ce0 | |
parent | 663562572b938d4908d7dba606ce0bfbee47d44a (diff) |
which is int not u_int so check for negative values. ok deraadt@, art@
-rw-r--r-- | sys/kern/kern_time.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 165587ffc7c..dec62053534 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_time.c,v 1.31 2002/07/25 22:18:27 nordin Exp $ */ +/* $OpenBSD: kern_time.c,v 1.32 2002/10/02 17:43:38 nordin Exp $ */ /* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */ /* @@ -420,13 +420,13 @@ sys_getitimer(p, v, retval) register_t *retval; { register struct sys_getitimer_args /* { - syscallarg(u_int) which; + syscallarg(int) which; syscallarg(struct itimerval *) itv; } */ *uap = v; struct itimerval aitv; int s; - if (SCARG(uap, which) > ITIMER_PROF) + if (SCARG(uap, which) < ITIMER_REAL || SCARG(uap, which) > ITIMER_PROF) return (EINVAL); s = splclock(); if (SCARG(uap, which) == ITIMER_REAL) { @@ -459,7 +459,7 @@ sys_setitimer(p, v, retval) register_t *retval; { register struct sys_setitimer_args /* { - syscallarg(u_int) which; + syscallarg(int) which; syscallarg(struct itimerval *) itv; syscallarg(struct itimerval *) oitv; } */ *uap = v; @@ -468,7 +468,7 @@ sys_setitimer(p, v, retval) int s, error; int timo; - if (SCARG(uap, which) > ITIMER_PROF) + if (SCARG(uap, which) < ITIMER_REAL || SCARG(uap, which) > ITIMER_PROF) return (EINVAL); itvp = SCARG(uap, itv); if (itvp && (error = copyin((void *)itvp, (void *)&aitv, |