phatcher / CsvReader

Extended version of Sebastian Lorien's fast CSV Reader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CsvReader.ReadNextRecord throws IndexOutOfRangeException

Metalnem opened this issue · comments

CsvReader.ReadNextRecord throws an IndexOutOfRangeException when reading the file from the attached archive. You can run the following code to reproduce it (the path variable should contain the path to the extracted file):

using (var file = File.OpenText(path))
using (var csv = new CsvReader(file, false))
{
  while (csv.ReadNextRecord()) { }
}

Found via SharpFuzz.

That file that is attached doesn't look like a csv file... It looks like a binary file to me:

image

What exactly are you trying to accomplish?

I was trying to determine if the ReadNextRecord always throws MalformedCsvException on malformed CSV inputs, and I discovered that it can sometimes throw IndexOutOfRangeException. This binary file is just one of several inputs that I managed to generate.