diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2005-03-24 02:40:27 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2005-03-24 02:40:27 +0000 |
commit | b0631f1ce3ba4aecaa18ce460a7fbe59efb2c1cf (patch) | |
tree | 220b359bec030a1e682ace570f51afe0a4cd6628 /sys/kern/vfs_subr.c | |
parent | 16ee8dc99e0a2a50e947df7367a183e8311f2571 (diff) |
always good to check for invalid values. ok marius pedro
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); |