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:
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>()?;