Do not mount volume if fs_version field in BPB is not zero

This commit is contained in:
Rafał Harabień 2018-06-17 16:34:08 +02:00
parent 8a5491a919
commit 4f08acf4ab

View File

@ -390,6 +390,10 @@ impl <T: ReadWriteSeek> FileSystem<T> {
boot.bpb
};
if bpb.fs_version != 0 {
return Err(Error::new(ErrorKind::Other, "unknown FS version"));
}
let total_sectors =
if bpb.total_sectors_16 == 0 { bpb.total_sectors_32 }
else { bpb.total_sectors_16 as u32 };