Source-Changes-HG archive

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

[src/trunk]: src/sys/nfs Check the passed file handle length _before_, not _a...



details:   https://anonhg.NetBSD.org/src/rev/b4c6629d296b
branches:  trunk
changeset: 513420:b4c6629d296b
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Jul 30 22:51:06 2001 +0000

description:
Check the passed file handle length _before_, not _after_ copyin()

diffstat:

 sys/nfs/nfs_vfsops.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r b012cded7090 -r b4c6629d296b sys/nfs/nfs_vfsops.c
--- a/sys/nfs/nfs_vfsops.c      Mon Jul 30 22:43:36 2001 +0000
+++ b/sys/nfs/nfs_vfsops.c      Mon Jul 30 22:51:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_vfsops.c,v 1.105 2001/07/30 22:23:42 fvdl Exp $    */
+/*     $NetBSD: nfs_vfsops.c,v 1.106 2001/07/30 22:51:06 jdolecek Exp $        */
 
 /*
  * Copyright (c) 1989, 1993, 1995
@@ -585,9 +585,9 @@
                nfs_decode_args(nmp, &args);
                return (0);
        }
-       error = copyin((caddr_t)args.fh, (caddr_t)nfh, args.fhsize);
        if (args.fhsize < 0 || args.fhsize > NFSX_V3FHMAX)
                return (EINVAL);
+       error = copyin((caddr_t)args.fh, (caddr_t)nfh, args.fhsize);
        if (error)
                return (error);
        error = copyinstr(path, pth, MNAMELEN-1, &len);



Home | Main Index | Thread Index | Old Index