Source-Changes-HG archive

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

[src/trunk]: src/sys/msdosfs check early for reads past EOF.



details:   https://anonhg.NetBSD.org/src/rev/41a8bd9c5b40
branches:  trunk
changeset: 515371:41a8bd9c5b40
user:      chs <chs%NetBSD.org@localhost>
date:      Sat Sep 22 22:14:29 2001 +0000

description:
check early for reads past EOF.

diffstat:

 sys/msdosfs/msdosfs_vnops.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (18 lines):

diff -r 544c91afc03c -r 41a8bd9c5b40 sys/msdosfs/msdosfs_vnops.c
--- a/sys/msdosfs/msdosfs_vnops.c       Sat Sep 22 21:46:50 2001 +0000
+++ b/sys/msdosfs/msdosfs_vnops.c       Sat Sep 22 22:14:29 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_vnops.c,v 1.112 2001/09/15 20:36:39 chs Exp $  */
+/*     $NetBSD: msdosfs_vnops.c,v 1.113 2001/09/22 22:14:29 chs Exp $  */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -471,6 +471,8 @@
                return (0);
        if (uio->uio_offset < 0)
                return (EINVAL);
+       if (uio->uio_offset >= de->de_FileSize)
+               return (0);
 
        if (vp->v_type == VREG) {
                while (uio->uio_resid > 0) {



Home | Main Index | Thread Index | Old Index