IReader.MoveToNextEntry() not terminating #80

Open
opened 2026-01-29 22:06:16 +00:00 by claunia · 0 comments
Owner

Originally created by @eklann on GitHub (Feb 9, 2016).

I have encountered an issue with reading corrupt rar-files. When reading the entries in the file, the method IReader.MoveToNextEntry does not terminate, and the programs hangs. The program still consumes a lot of CPU, so it is doing something. I have tried to wait, but after 20 hours nothing has happened.

The following code can reproduce the issue:

using SharpCompress.Archive;
using SharpCompress.Reader;
using System;

namespace NonTerminatingRar
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            IArchive archive = ArchiveFactory.Open(args[0]);
            using (IReader reader = archive.ExtractAllEntries())
            {
                while (reader.MoveToNextEntry())
                {
                    Console.WriteLine(reader.Entry.Key);
                }
            }
        }
    }
}

I am using Sharpcompress 0.11.4 from nuget.org

I also have a file that can be used to reproduce the problem, but I am not sure where to send it? It is approximately 100MB

Originally created by @eklann on GitHub (Feb 9, 2016). I have encountered an issue with reading corrupt rar-files. When reading the entries in the file, the method IReader.MoveToNextEntry does not terminate, and the programs hangs. The program still consumes a lot of CPU, so it is doing something. I have tried to wait, but after 20 hours nothing has happened. The following code can reproduce the issue: ``` C# using SharpCompress.Archive; using SharpCompress.Reader; using System; namespace NonTerminatingRar { internal class Program { private static void Main(string[] args) { IArchive archive = ArchiveFactory.Open(args[0]); using (IReader reader = archive.ExtractAllEntries()) { while (reader.MoveToNextEntry()) { Console.WriteLine(reader.Entry.Key); } } } } } ``` I am using Sharpcompress 0.11.4 from nuget.org I also have a file that can be used to reproduce the problem, but I am not sure where to send it? It is approximately 100MB
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#80