Closed fuzzah closed 3 months ago
Stepping through, the code correctly identifies the EOF here: https://github.com/adamhathcock/sharpcompress/blob/6fc4b045fde70c42df738d203c453082354e9558/src/SharpCompress/Compressors/BZip2/CBZip2InputStream.cs#L394-L397 and then proceeds to... do nothing? https://github.com/adamhathcock/sharpcompress/blob/6fc4b045fde70c42df738d203c453082354e9558/src/SharpCompress/Compressors/BZip2/CBZip2InputStream.cs#L42-L52
Perhaps the fix is just to make this function actually throw an exception instead of silently passing?
Seems like I should have ported the exception.
So as #850 is merged, this should be closed?
Thanks!
In continuation of #841. The following code results in an infinite loop in SharpCompress:
The stack trace (created with the
dotnet stack
tool):This byte sequence written to a file gets detected as "bzip2 compressed data" by the
file
tool, butbzip2
fails to read it with the error message "bzip2: Compressed file ends unexpectedly".Found by Linux Verification Center (linuxtesting.org) with AFL++ and SharpFuzz. Reporter: Valery Korolyov (v.korolyov@gardatech.ru) Organization: Garda Technologies (info@gardatech.ru)