summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-09-02 10:24:55 +0000
committerdg <dg@FreeBSD.org>1994-09-02 10:24:55 +0000
commit08512a312787c805fb1d699dd396b240686e267d (patch)
treef602020ef94f56d54ba62113949fb6e770a378ea /sys/ufs
parent70a7b53e066a66692fa03c5ba75393c4fda4bd24 (diff)
downloadFreeBSD-src-08512a312787c805fb1d699dd396b240686e267d.zip
FreeBSD-src-08512a312787c805fb1d699dd396b240686e267d.tar.gz
panic if length is < 0 in ffs_truncate().
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index a7cd2a4..04b6c70 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 <sys/param.h>
@@ -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 &&
OpenPOWER on IntegriCloud