From 35d014194517b1ea2ec1f056f9eb2622dfad3543 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 5 Aug 1998 16:05:19 +0000 Subject: delete bogus casts of msg_iovlen to u_int since msg_iovlen is already a u_int --- sys/compat/common/uipc_syscalls_43.c | 16 +++++++--------- sys/kern/uipc_syscalls.c | 16 +++++++--------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/sys/compat/common/uipc_syscalls_43.c b/sys/compat/common/uipc_syscalls_43.c index 6263b4e6b5e..4388af383e0 100644 --- a/sys/compat/common/uipc_syscalls_43.c +++ b/sys/compat/common/uipc_syscalls_43.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_syscalls_43.c,v 1.3 1996/04/18 21:21:36 niklas Exp $ */ +/* $OpenBSD: uipc_syscalls_43.c,v 1.4 1998/08/05 16:05:16 millert Exp $ */ /* $NetBSD: uipc_syscalls_43.c,v 1.5 1996/03/14 19:31:50 christos Exp $ */ /* @@ -219,12 +219,11 @@ compat_43_sys_recvmsg(p, v, retval) sizeof (struct omsghdr)); if (error) return (error); - if ((u_int)msg.msg_iovlen >= UIO_SMALLIOV) { - if ((u_int)msg.msg_iovlen >= UIO_MAXIOV) + if (msg.msg_iovlen >= UIO_SMALLIOV) { + if (msg.msg_iovlen >= UIO_MAXIOV) return (EMSGSIZE); MALLOC(iov, struct iovec *, - sizeof(struct iovec) * (u_int)msg.msg_iovlen, M_IOV, - M_WAITOK); + sizeof(struct iovec) * msg.msg_iovlen, M_IOV, M_WAITOK); } else iov = aiov; msg.msg_flags = SCARG(uap, flags) | MSG_COMPAT; @@ -292,12 +291,11 @@ compat_43_sys_sendmsg(p, v, retval) sizeof (struct omsghdr)); if (error) return (error); - if ((u_int)msg.msg_iovlen >= UIO_SMALLIOV) { - if ((u_int)msg.msg_iovlen >= UIO_MAXIOV) + if (msg.msg_iovlen >= UIO_SMALLIOV) { + if (msg.msg_iovlen >= UIO_MAXIOV) return (EMSGSIZE); MALLOC(iov, struct iovec *, - sizeof(struct iovec) * (u_int)msg.msg_iovlen, M_IOV, - M_WAITOK); + sizeof(struct iovec) * msg.msg_iovlen, M_IOV, M_WAITOK); } else iov = aiov; error = copyin((caddr_t)msg.msg_iov, (caddr_t)iov, diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 8470e9fb5fe..0825988e79e 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_syscalls.c,v 1.10 1998/07/28 19:47:08 millert Exp $ */ +/* $OpenBSD: uipc_syscalls.c,v 1.11 1998/08/05 16:05:18 millert Exp $ */ /* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */ /* @@ -387,12 +387,11 @@ sys_sendmsg(p, v, retval) return (error); if (msg.msg_iovlen <= 0) return (EINVAL); - if ((u_int)msg.msg_iovlen >= UIO_SMALLIOV) { - if ((u_int)msg.msg_iovlen >= UIO_MAXIOV) + if (msg.msg_iovlen >= UIO_SMALLIOV) { + if (msg.msg_iovlen >= UIO_MAXIOV) return (EMSGSIZE); MALLOC(iov, struct iovec *, - sizeof(struct iovec) * (u_int)msg.msg_iovlen, M_IOV, - M_WAITOK); + sizeof(struct iovec) * msg.msg_iovlen, M_IOV, M_WAITOK); } else iov = aiov; if (msg.msg_iovlen && @@ -573,12 +572,11 @@ sys_recvmsg(p, v, retval) return (error); if (msg.msg_iovlen <= 0) return (EINVAL); - if ((u_int)msg.msg_iovlen >= UIO_SMALLIOV) { - if ((u_int)msg.msg_iovlen >= UIO_MAXIOV) + if (msg.msg_iovlen >= UIO_SMALLIOV) { + if (msg.msg_iovlen >= UIO_MAXIOV) return (EMSGSIZE); MALLOC(iov, struct iovec *, - sizeof(struct iovec) * (u_int)msg.msg_iovlen, M_IOV, - M_WAITOK); + sizeof(struct iovec) * msg.msg_iovlen, M_IOV, M_WAITOK); } else iov = aiov; #ifdef COMPAT_OLDSOCK -- cgit v1.2.3