No exception with corrupt file #238

Open
opened 2026-01-29 22:08:52 +00:00 by claunia · 4 comments
Owner

Originally created by @InBerg on GitHub (Sep 14, 2017).

Hi,

actualy we decompress our GZIP TAR file in C# with the command line tool "Tar.exe".
We start an process and parse the result of the command line.
I want to change this by unsing Sharpcomress.
We have sereval unit test for the decompression.
When I use Sharpcomeress to decompress one of the unit tests failed.
This test try to extract a corrupt TAR file.
The "Tar.exe" thorws an exception.
Sharpcomress decompress the file without an exception. Is this a known bug?
This is the code I use to decompress the attached file:

public bool Extract(string filename, string extractPath)
{
try
{
using (Stream stream = File.OpenRead(filename))
{
var reader = ReaderFactory.Open(stream);
reader.WriteAllToDirectory(extractPath, new ExtractionOptions { ExtractFullPath = true, Overwrite = true });
}
return true;
}
catch (Exception e)
{
Console.WriteLine(e);
return false;
}
}

Kind regards Mike

20150427_140120_f4_3d_80_00_01_6e.zip

Originally created by @InBerg on GitHub (Sep 14, 2017). Hi, actualy we decompress our GZIP TAR file in C# with the command line tool "Tar.exe". We start an process and parse the result of the command line. I want to change this by unsing Sharpcomress. We have sereval unit test for the decompression. When I use Sharpcomeress to decompress one of the unit tests failed. This test try to extract a corrupt TAR file. The "Tar.exe" thorws an exception. Sharpcomress decompress the file without an exception. Is this a known bug? This is the code I use to decompress the attached file: public bool Extract(string filename, string extractPath) { try { using (Stream stream = File.OpenRead(filename)) { var reader = ReaderFactory.Open(stream); reader.WriteAllToDirectory(extractPath, new ExtractionOptions { ExtractFullPath = true, Overwrite = true }); } return true; } catch (Exception e) { Console.WriteLine(e); return false; } } Kind regards Mike [20150427_140120_f4_3d_80_00_01_6e.zip](https://github.com/adamhathcock/sharpcompress/files/1302631/20150427_140120_f4_3d_80_00_01_6e.zip)
Author
Owner

@adamhathcock commented on GitHub (Sep 14, 2017):

SharpCompress does not do any validation of CRCs that GZip or whatever might have. The extraction will look successful. It's not a bug but the lack of a CRC validation feature.

@adamhathcock commented on GitHub (Sep 14, 2017): SharpCompress does not do any validation of CRCs that GZip or whatever might have. The extraction will look successful. It's not a bug but the lack of a CRC validation feature.
Author
Owner

@InBerg commented on GitHub (Sep 15, 2017):

The TAR.exe say this:
tar -tf 20150427_140120_f4_3d_80_00_01_6e.scd1
Warning: non-standard extension used on a compressed archive.
Exception: System.Exception: header checksum is invalid.
bei Ionic.Tar._internal_ListOrExtract(String archive, Boolean wantExtract)
bei Ionic.TarApp.ListContents()
bei Ionic.TarApp.Main(String[] args)

Is it possible to make this to a feature request?

Tar.zip

@InBerg commented on GitHub (Sep 15, 2017): The TAR.exe say this: tar -tf 20150427_140120_f4_3d_80_00_01_6e.scd1 Warning: non-standard extension used on a compressed archive. Exception: System.Exception: header checksum is invalid. bei Ionic.Tar._internal_ListOrExtract(String archive, Boolean wantExtract) bei Ionic.TarApp.ListContents() bei Ionic.TarApp.Main(String[] args) Is it possible to make this to a feature request? [Tar.zip](https://github.com/adamhathcock/sharpcompress/files/1305475/Tar.zip)
Author
Owner

@adamhathcock commented on GitHub (Sep 15, 2017):

It is possible. CRC is already a known missing feature. I'm accepting pull requests if you'd like to do it.

@adamhathcock commented on GitHub (Sep 15, 2017): It is possible. CRC is already a known missing feature. I'm accepting pull requests if you'd like to do it.
Author
Owner

@InBerg commented on GitHub (Sep 15, 2017):

How can I do that?

@InBerg commented on GitHub (Sep 15, 2017): How can I do that?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#238