diff options
author | Miles Bader <miles@gnu.org> | 1997-02-12 17:20:17 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1997-02-12 17:20:17 +0000 |
commit | 74d30eec046b3d362cdb7a9bc87f25d697d51abb (patch) | |
tree | 1094bab435380e221813ce514ef04222f693a5ac /libdiskfs | |
parent | d165827f4d2de2649eaaa2efe7413faaba4dd38f (diff) |
(diskfs_S_io_write):
Check OFF for validity and return EINVAL if it's bogus.
Diffstat (limited to 'libdiskfs')
-rw-r--r-- | libdiskfs/io-write.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libdiskfs/io-write.c b/libdiskfs/io-write.c index 8b68e1a1..e84bdecb 100644 --- a/libdiskfs/io-write.c +++ b/libdiskfs/io-write.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -50,6 +50,11 @@ diskfs_S_io_write (struct protid *cred, cred->po->filepointer = np->dn_stat.st_size; off = cred->po->filepointer; } + if (off < 0) + { + err = EINVAL; + goto out; + } err = 0; while (off + (off_t) datalen > np->allocsize) |