From 6c3825f2b750bf9b913c6ea986739e648c470603 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Wed, 2 Oct 2013 20:30:15 +0200 Subject: Check for negative sizes in file_set_size * libdiskfs/file-set-size.c (diskfs_S_file_set_size): Return EINVAL if size is negative. * libnetfs/file-set-size.c (netfs_S_file_set_size): Likewise. * libtreefs/s-file.c (treefs_S_file_set_size): Likewise. * storeio/io.c (trivfs_S_file_set_size): Likewise. * term/users.c (trivfs_S_file_set_size): Likewise. * trans/null.c (trivfs_S_file_set_size): Likewise. * trans/streamio.c (trivfs_S_file_set_size): Likewise. --- term/users.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'term') diff --git a/term/users.c b/term/users.c index 9d745c6d..eacd150a 100644 --- a/term/users.c +++ b/term/users.c @@ -1808,6 +1808,8 @@ trivfs_S_file_set_size (struct trivfs_protid *cred, { if (!cred) return EOPNOTSUPP; + else if (size < 0) + return EINVAL; pthread_mutex_lock (&global_lock); if ((cred->po->openmodes & O_WRITE) == 0) { -- cgit v1.2.3