Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/osf1 easy kmem_alloc(0)



details:   https://anonhg.NetBSD.org/src/rev/5bf512b87ebd
branches:  trunk
changeset: 339754:5bf512b87ebd
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Aug 08 12:02:35 2015 +0000

description:
easy kmem_alloc(0)

ok shm@

diffstat:

 sys/compat/osf1/osf1_socket.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r a82838b3dcc8 -r 5bf512b87ebd sys/compat/osf1/osf1_socket.c
--- a/sys/compat/osf1/osf1_socket.c     Sat Aug 08 10:56:55 2015 +0000
+++ b/sys/compat/osf1/osf1_socket.c     Sat Aug 08 12:02:35 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_socket.c,v 1.20 2010/04/23 15:19:21 rmind Exp $ */
+/* $NetBSD: osf1_socket.c,v 1.21 2015/08/08 12:02:35 maxv Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: osf1_socket.c,v 1.20 2010/04/23 15:19:21 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osf1_socket.c,v 1.21 2015/08/08 12:02:35 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -116,7 +116,7 @@
                return (EINVAL);
 
        iov_len = bsd_msghdr.msg_iovlen;
-       if (iov_len > IOV_MAX)
+       if ((iov_len > IOV_MAX) || (iov_len == 0))
                return EMSGSIZE;
        bsd_iovec = kmem_alloc(iov_len * sizeof(struct iovec), KM_SLEEP);
        bsd_msghdr.msg_iov = bsd_iovec;



Home | Main Index | Thread Index | Old Index