summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2010-07-23 08:47:59 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2010-07-23 08:47:59 +0200
commitb0ed117995b004208728ba9d90833b43d80f237f (patch)
tree7de49eadddb1fa31075601c473efaa0604be3540
parentd62dbeee25bf33300165b52b7b43cb0bee9e7287 (diff)
Fix NTFS undelete of sparse file
-rw-r--r--src/ntfs_udl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ntfs_udl.c b/src/ntfs_udl.c
index 43e53e7..b93c381 100644
--- a/src/ntfs_udl.c
+++ b/src/ntfs_udl.c
@@ -960,7 +960,7 @@ static int undelete_file(ntfs_volume *vol, long long inode)
if (rl[i].lcn == LCN_HOLE) {
log_verbose("File has a sparse section.\n");
memset(buffer, 0, bufsize);
- for (k = 0; k < rl[k].length * vol->cluster_size; k += bufsize) {
+ for (k = 0; k < rl[i].length * vol->cluster_size; k += bufsize) {
if (write_data(fd, buffer, bufsize) < bufsize) {
log_error("Write failed\n");
close(fd);