From 80487422f7c7ec5057f53f8d0b3caffacc03387f Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Tue, 6 May 2003 22:03:28 +0000 Subject: [PATCH] Fix off-by-one error in ntfs_cluster_{read,write}(). (Ian Jackson) (Logical change 1.135) --- libntfs/disk_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libntfs/disk_io.c b/libntfs/disk_io.c index 037fe9ac..e0e04ba5 100644 --- a/libntfs/disk_io.c +++ b/libntfs/disk_io.c @@ -290,7 +290,7 @@ s64 ntfs_cluster_read(const ntfs_volume *vol, const s64 lcn, errno = EINVAL; return -1; } - if (vol->nr_clusters <= lcn + count) { + if (vol->nr_clusters < lcn + count) { errno = ESPIPE; return -1; } @@ -323,7 +323,7 @@ s64 ntfs_cluster_write(const ntfs_volume *vol, const s64 lcn, errno = EINVAL; return -1; } - if (vol->nr_clusters <= lcn + count) { + if (vol->nr_clusters < lcn + count) { errno = ESPIPE; return -1; }