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