From b0631f1ce3ba4aecaa18ce460a7fbe59efb2c1cf Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 24 Mar 2005 02:40:27 +0000 Subject: always good to check for invalid values. ok marius pedro --- sys/kern/vfs_subr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/kern/vfs_subr.c') diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 1068ce3d8e7..26cf7435dda 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.109 2005/01/10 11:58:34 pedro Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.110 2005/03/24 02:40:26 tedu Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -1571,7 +1571,8 @@ vfs_hang_addrlist(mp, nep, argp) mp->mnt_flag |= MNT_DEFEXPORTED; return (0); } - if (argp->ex_addrlen > MLEN) + if (argp->ex_addrlen > MLEN || argp->ex_masklen > MLEN || + argp->ex_addrlen < 0 || argp->ex_masklen < 0) return (EINVAL); i = sizeof(struct netcred) + argp->ex_addrlen + argp->ex_masklen; np = (struct netcred *)malloc(i, M_NETADDR, M_WAITOK); -- cgit v1.2.3