Verify that segment doesn't exceed maximum size.
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 2 Nov 1992 03:15:08 +0000 (19:15 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 2 Nov 1992 03:15:08 +0000 (19:15 -0800)
SCCS-vsn: libexec/lfs_cleanerd/library.c 5.7

usr/src/libexec/lfs_cleanerd/library.c

index a717062..01a71c9 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)library.c  5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)library.c  5.7 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -460,7 +460,8 @@ pseg_valid (fsp, ssp)
        u_long *datap;
        SEGUSE *sup;
 
        u_long *datap;
        SEGUSE *sup;
 
-       if ((nblocks = dump_summary(&fsp->fi_lfs, ssp, 0, NULL)) <= 0)
+       if ((nblocks = dump_summary(&fsp->fi_lfs, ssp, 0, NULL)) <= 0 ||
+           nblocks > fsp->fi_lfs.lfs_ssize - 1)
                return(0);
                
        /* check data/inode block(s) checksum too */
                return(0);
                
        /* check data/inode block(s) checksum too */