adamhathcock / sharpcompress

SharpCompress is a fully managed C# library to deal with many compression types and formats.
MIT License
2.22k stars 476 forks source link

NullReference Exception in RarRijndael.Initialize() #757

Open SirSparkles opened 10 months ago

SirSparkles commented 10 months ago

Some Clients are reporting:

System.NullReferenceException: Object reference not set to an instance of an object. at SharpCompress.Common.Rar.RarRijndael.Initialize() at SharpCompress.Common.Rar.RarCryptoWrapper..ctor(Stream actualStream, String password, Byte[] salt) at SharpCompress.Archives.Rar.SeekableFilePart.GetCompressedStream() at SharpCompress.Compressors.Rar.MultiVolumeReadOnlyStream.InitializeNextFilePart() at SharpCompress.Archives.Rar.RarArchiveEntry.OpenEntryStream() at SharpCompress.Archives.IArchiveEntryExtensions.WriteTo(IArchiveEntry archiveEntry, Stream streamToWriteTo) at SharpCompress.Archives.IArchiveEntryExtensions.<>c__DisplayClass2_0.b__0(String x, FileMode fm) at SharpCompress.Common.ExtractionMethods.WriteEntryToFile(IEntry entry, String destinationFileName, ExtractionOptions options, Action`2 openAndWrite)

SirSparkles commented 10 months ago

also at: System.NullReferenceException: Object reference not set to an instance of an object. at SharpCompress.Common.Rar.RarRijndael.Initialize() at SharpCompress.Common.Rar.RarRijndael.InitializeFrom(String password, Byte[] salt) at SharpCompress.Common.Rar.RarCryptoWrapper..ctor(Stream actualStream, String password, Byte[] salt) at SharpCompress.Archives.Rar.SeekableFilePart.GetCompressedStream() at SharpCompress.Compressors.Rar.MultiVolumeReadOnlyStream.InitializeNextFilePart() at SharpCompress.Compressors.Rar.MultiVolumeReadOnlyStream..ctor(IEnumerable1 parts, IExtractionListener streamListener) at SharpCompress.Archives.Rar.RarArchiveEntry.OpenEntryStream() at SharpCompress.Archives.IArchiveEntryExtensions.WriteTo(IArchiveEntry archiveEntry, Stream streamToWriteTo) at SharpCompress.Archives.IArchiveEntryExtensions.<>c__DisplayClass2_0.<WriteToFile>b__0(String x, FileMode fm) at SharpCompress.Common.ExtractionMethods.WriteEntryToFile(IEntry entry, String destinationFileName, ExtractionOptions options, Action2 openAndWrite)

labworkx commented 10 months ago

Probably the same as https://github.com/adamhathcock/sharpcompress/issues/743

I encountered this error and was expecting a SharpCompress.Common.CryptographicException but got also a null reference.

Erior commented 10 months ago

Guess it is a bit inconvenient but please build sharpcompress from master branch and test with that, I don't think we have released the change that got merged for this issue.