ironfede / openmcdf

Microsoft Compound File .net component - pure C# - netstandard 2.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

System.OutOfMemoryException when reading corrupt Word document

Numpsy opened this issue · comments

Related to #30, but blowing up in a different location:

if you try to open the file out_of_memory_2.zip (generated by SharpFuzz) with the current OpenMcdf, you get a System.OutOfMemoryException with the call stack:

at System.Collections.Generic.List`1.set_Capacity(Int32 value)
   at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
   at System.Collections.Generic.List`1.Add(T item)
   at OpenMcdf.CompoundFile.GetDifatSectorChain()
   at OpenMcdf.CompoundFile.GetFatSectorChain()
   at OpenMcdf.CompoundFile.GetNormalSectorChain(Int32 secID)
   at OpenMcdf.CompoundFile.LoadDirectories()
   at OpenMcdf.CompoundFile.Load(Stream stream)
   at OpenMcdf.CompoundFile..ctor(Stream stream)
   
Result Message:	System.OutOfMemoryException : Array dimensions exceeded supported range.