Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0d8b673
)
Fix divide by zero error in blkid's NTFS probing logic
author
Theodore Ts'o
<tytso@mit.edu>
Sun, 24 Jun 2007 21:17:24 +0000
(17:17 -0400)
committer
Theodore Ts'o
<tytso@mit.edu>
Sun, 24 Jun 2007 21:17:24 +0000
(17:17 -0400)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/blkid/probe.c
patch
|
blob
|
history
diff --git
a/lib/blkid/probe.c
b/lib/blkid/probe.c
index
0a1d8db
..
b5bcdcf
100644
(file)
--- a/
lib/blkid/probe.c
+++ b/
lib/blkid/probe.c
@@
-420,8
+420,11
@@
static int probe_ntfs(struct blkid_probe *probe,
(ns->bios_parameter_block[1] << 8);
sectors_per_cluster = ns->bios_parameter_block[2];
+ if ((bytes_per_sector < 512) || (sectors_per_cluster == 0))
+ return 1;
+
if (ns->cluster_per_mft_record < 0)
- mft_record_size = 1 <<
- ns->cluster_per_mft_record
;
+ mft_record_size = 1 <<
(0-ns->cluster_per_mft_record)
;
else
mft_record_size = ns->cluster_per_mft_record *
sectors_per_cluster * bytes_per_sector;