From 4f08acf4abccc7fbad0fee6b18d0b2aa6e27093e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Harabie=C5=84?= Date: Sun, 17 Jun 2018 16:34:08 +0200 Subject: [PATCH] Do not mount volume if fs_version field in BPB is not zero --- src/fs.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fs.rs b/src/fs.rs index 0b7ea4e..6733b16 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -390,6 +390,10 @@ impl FileSystem { 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 };