fs-return-EIO-when-starting-read-beyond-EOF-20040202
authorDerrick Brashear <shadow@dementia.org>
Tue, 3 Feb 2004 05:43:23 +0000 (05:43 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 3 Feb 2004 05:43:23 +0000 (05:43 +0000)
FIXES 1493

large file support asserted when attempting to read beginning past
the end of the file

src/viced/afsfileprocs.c

index 1b271dc..6acbf12 100644 (file)
@@ -6676,7 +6676,7 @@ FetchData_RXStyle(Volume * volptr, Vnode * targetptr,
     tlen = FDH_SIZE(fdP);
     ViceLog(25,
            ("FetchData_RXStyle: file size %llu\n", (afs_uintmax_t) tlen));
-    if (tlen < 0) {
+    if ((tlen < 0) || (Pos > tlen)) {
        FDH_CLOSE(fdP);
        return EIO;
     }