Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/RustyMft.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthew seyer <matthew.seyer@gmail.com>2017-04-21 08:00:37 +0300
committermatthew seyer <matthew.seyer@gmail.com>2017-04-21 08:00:37 +0300
commitb3c89de9ec4b139f96b9778b9f1c4e2ea6e823b4 (patch)
tree7ac92b14294946e0d9e6aef9c123b257792a827c /src/entry.rs
parentc103f961ffca9828fb4ce36a836ea75532df0841 (diff)
added an invalid entry signature error
Diffstat (limited to 'src/entry.rs')
-rw-r--r--src/entry.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/entry.rs b/src/entry.rs
index 74f4a6c..0be1a1b 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -57,6 +57,14 @@ impl EntryHeader{
};
entry_header.signature = reader.read_u32::<LittleEndian>()?;
+ if entry_header.signature != 1162627398 {
+ return Err(
+ MftError::invalid_entry_signature(
+ format!("Bad signature: {:04X}",entry_header.signature)
+ )
+ );
+ }
+
entry_header.usa_offset = reader.read_u16::<LittleEndian>()?;
entry_header.usa_size = reader.read_u16::<LittleEndian>()?;
entry_header.logfile_sequence_number = reader.read_u64::<LittleEndian>()?;