From d165827f4d2de2649eaaa2efe7413faaba4dd38f Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 12 Feb 1997 17:19:48 +0000 Subject: (diskfs_S_io_read): Check OFF for validity and return EINVAL if it's bogus. --- libdiskfs/io-read.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libdiskfs/io-read.c') diff --git a/libdiskfs/io-read.c b/libdiskfs/io-read.c index a5dd148a..78ccf064 100644 --- a/libdiskfs/io-read.c +++ b/libdiskfs/io-read.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994, 1995, 1996 Free Software Foundation + Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -46,6 +46,11 @@ diskfs_S_io_read (struct protid *cred, if (off == -1) off = cred->po->filepointer; + if (off < 0) + { + mutex_unlock (&np->lock); + return EINVAL; + } if (off > np->dn_stat.st_size) maxread = 0; -- cgit v1.2.3