diff options
author | relan <relan@users.noreply.github.com> | 2009-10-18 07:38:24 +0000 |
---|---|---|
committer | relan <relan@users.noreply.github.com> | 2015-08-24 08:26:10 +0300 |
commit | a2b6db4613aadbdedc6ec5ea4f4c8f797a460dc8 (patch) | |
tree | 2557e08cd85d25c4d48cfa1204de14eb7e47e156 /fsck | |
parent | 56db9d7aeee80ea109ee347d007ed679cf82d92f (diff) | |
download | android_external_exfat-a2b6db4613aadbdedc6ec5ea4f4c8f797a460dc8.tar.gz android_external_exfat-a2b6db4613aadbdedc6ec5ea4f4c8f797a460dc8.tar.bz2 android_external_exfat-a2b6db4613aadbdedc6ec5ea4f4c8f797a460dc8.zip |
Fix integer overflow in fsck.
Incorrect volume size was printed for big volumes.
Diffstat (limited to 'fsck')
-rw-r--r-- | fsck/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fsck/main.c b/fsck/main.c index a8dd10d..e516650 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -28,7 +28,8 @@ static void sbck(const struct exfat* ef) { const uint32_t block_size = (1 << ef->sb->block_bits); /* in bytes */ const uint32_t cluster_size = CLUSTER_SIZE(*ef->sb); /* in bytes */ - const uint64_t total = le32_to_cpu(ef->sb->cluster_count) * cluster_size; + const uint64_t total = (uint64_t) le32_to_cpu(ef->sb->cluster_count) * + cluster_size; #if 0 /* low-level info */ printf("First block %8"PRIu64"\n", |