OSDN Git Service

Forced 64-bit computation of inode number in ntfsundelete
authorJean-Pierre André <jpandre@users.sourceforge.net>
Tue, 30 Jul 2013 09:07:12 +0000 (11:07 +0200)
committerJean-Pierre André <jpandre@users.sourceforge.net>
Tue, 30 Jul 2013 09:07:12 +0000 (11:07 +0200)
An inode number computation was done with 32 bits, and could (theoretically)
lead to truncation.

ntfsprogs/ntfsundelete.c

index 4a9b3ec..b74f4c5 100644 (file)
@@ -2180,7 +2180,8 @@ static int scan_disk(ntfs_volume *vol)
        ntfs_attr *attr;
        long long size;
        long long bmpsize;
-       int i, j, k, b;
+       long long i;
+       int j, k, b;
        int percent;
        struct ufile *file;
        regex_t re;
@@ -2238,7 +2239,8 @@ static int scan_disk(ntfs_volume *vol)
                                        continue;
                                file = read_record(vol, (i+j)*8+k);
                                if (!file) {
-                                       ntfs_log_error("Couldn't read MFT Record %d.\n", (i+j)*8+k);
+                                       ntfs_log_error("Couldn't read MFT Record %lld.\n",
+                                                       (long long)(i+j)*8+k);
                                        continue;
                                }