Skip to content

Commit

Permalink
Check for invalid entry offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
trumank committed May 29, 2023
1 parent 4578063 commit d594642
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions repak/src/pak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ impl Pak {
let mut encoded_entries = io::Cursor::new(&encoded_entries);
for (dir_name, dir) in fdi {
for (file_name, encoded_offset) in dir {
if *encoded_offset == 0x80000000 {
println!("{file_name:?} has invalid offset: 0x{encoded_offset:08x}");
continue;
}
encoded_entries.seek(io::SeekFrom::Start(*encoded_offset as u64))?;
let entry =
super::entry::Entry::read_encoded(&mut encoded_entries, version)?;
Expand Down

0 comments on commit d594642

Please sign in to comment.