From 01825ed3fa5da0d1933d3eb33271bf4494a5df3b Mon Sep 17 00:00:00 2001 From: David Greenman Date: Fri, 2 Sep 1994 10:24:55 +0000 Subject: [PATCH] panic if length is < 0 in ffs_truncate(). --- sys/ufs/ffs/ffs_inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index a7cd2a41f392..04b6c700644c 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_inode.c 8.5 (Berkeley) 12/30/93 - * $Id: ffs_inode.c,v 1.5 1994/08/03 08:19:35 davidg Exp $ + * $Id: ffs_inode.c,v 1.6 1994/08/29 06:09:13 davidg Exp $ */ #include @@ -163,6 +163,8 @@ ffs_truncate(ap) int aflags, error, allerror; off_t osize; + if (length < 0) + panic("ffs_truncate: invalid length"); oip = VTOI(ovp); tv = time; if (ovp->v_type == VLNK &&