ntfs_cluster_read and ntfs_cluster_write prevent you from accessing
areas outside the volume, by checking the parameters against the
volume size.
However, they both have an off-by-one error which prevents accesses to
the last cluster.
Ian.
--- disk_io.c.wrongeq 2003-05-05 01:21:26.000000000 +0100
+++ disk_io.c 2003-05-05 01:21:32.000000000 +0100
@@ -330,7 +330,7 @@
errno = EINVAL;
return -1;
}
- if (vol->nr_clusters <= lcn + count) {
+ if (vol->nr_clusters < lcn + count) {
errno = ESPIPE;
return -1;
}
@@ -363,7 +363,7 @@
errno = EINVAL;
return -1;
}
- if (vol->nr_clusters <= lcn + count) {
+ if (vol->nr_clusters < lcn + count) {
errno = ESPIPE;
return -1;
}
|