Skip to content

Commit

Permalink
Added cyclic sector chain check to CompoundFile.GetMiniSectorChain
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiedner, Daniel committed Oct 24, 2018
1 parent 6e03dc5 commit 27775bd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sources/OpenMcdf/CompoundFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1507,8 +1507,13 @@ StreamView miniFATView
result.Add(ms);

miniFATView.Seek(nextSecID * 4, SeekOrigin.Begin);
nextSecID = miniFATReader.ReadInt32();
}
int next = miniFATReader.ReadInt32();

if (next != nextSecID)
nextSecID = next;
else
throw new CFCorruptedFileException("Cyclic sector chain found. File is corrupted");
}
}
return result;
}
Expand Down

0 comments on commit 27775bd

Please sign in to comment.