Fix off-by-one error in ntfs_cluster_{read,write}(). (Ian Jackson)

(Logical change 1.135)
edge.strict_endians
cantab.net!aia21 2003-05-06 22:03:28 +00:00
parent 7599028d3e
commit 80487422f7
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}