summaryrefslogtreecommitdiffstats
path: root/sys/kern/sysv_shm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/sysv_shm.c')
-rw-r--r--sys/kern/sysv_shm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c
index a64c7f3..7e9073b 100644
--- a/sys/kern/sysv_shm.c
+++ b/sys/kern/sysv_shm.c
@@ -784,7 +784,7 @@ shmsys(td, uap)
struct thread *td;
/* XXX actually varargs. */
struct shmsys_args /* {
- u_int which;
+ int which;
int a2;
int a3;
int a4;
@@ -794,7 +794,8 @@ shmsys(td, uap)
if (!jail_sysvipc_allowed && jailed(td->td_ucred))
return (ENOSYS);
- if (uap->which >= sizeof(shmcalls)/sizeof(shmcalls[0]))
+ if (uap->which < 0 ||
+ uap->which >= sizeof(shmcalls)/sizeof(shmcalls[0]))
return (EINVAL);
mtx_lock(&Giant);
error = (*shmcalls[uap->which])(td, &uap->a2);
OpenPOWER on IntegriCloud