Permanent exception in `Microsoft.FileFormats.PDB.PDBFile.ReadDirectory()`
ww898 opened this issue · comments
Mikhail Pilin commented
Microsoft.SymbolStore v1.0.405901
Windows 10 Pro 22H2 x64 Build 19045
Exception on parsing Windows PDB file, because one of stream sizes is 0xFFFFFFFF
:
ERROR: System.AggregateException: One or more errors occurred. (Arithmetic operation resulted in an overflow.)
---> System.OverflowException: Arithmetic operation resulted in an overflow.
at Microsoft.FileFormats.PDB.PDBFile.ToPageCount(UInt32 size)
at Microsoft.FileFormats.PDB.PDBFile.CreatePagedAddressSpace(IAddressSpace indicesData, UInt64 offset, UInt32 length)
at Microsoft.FileFormats.PDB.PDBFile.ReadDirectory()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at Microsoft.FileFormats.PDB.PDBFile.get_Streams()
at Microsoft.FileFormats.PDB.PDBFile.<.ctor>b__5_2()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at Microsoft.FileFormats.PDB.PDBFile.get_DbiStream()
...
There is no any checking for streamSizes[i]
here:
symstore/src/Microsoft.FileFormats/PDB/PDBFile.cs
Lines 60 to 61 in 65e1cd4
P.S. v1.0.215101 has no errors!!!
Mike McLaughlin commented
This has been fixed in PR #401.