Ignore volume ID and label if signature is not valid.

This commit is contained in:
Rafał Harabień 2017-11-08 20:03:21 +01:00
parent 5c0ad0ce18
commit 8a8ee3c51a

View File

@ -121,6 +121,12 @@ impl BiosParameterBlock {
rdr.read_exact(&mut bpb.volume_label)?; rdr.read_exact(&mut bpb.volume_label)?;
rdr.read_exact(&mut bpb.fs_type_label)?; rdr.read_exact(&mut bpb.fs_type_label)?;
} }
if bpb.ext_sig != 0x29 {
// fields after ext_sig are not used - clean them
bpb.volume_id = 0;
bpb.volume_label = [0; 11];
bpb.fs_type_label = [0; 8];
}
Ok(bpb) Ok(bpb)
} }
} }