Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CsvReader.ReadNextRecord throws IndexOutOfRangeException #67

Open
Metalnem opened this issue Dec 24, 2018 · 2 comments
Open

CsvReader.ReadNextRecord throws IndexOutOfRangeException #67

Metalnem opened this issue Dec 24, 2018 · 2 comments

Comments

@Metalnem
Copy link

Metalnem commented Dec 24, 2018

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.

@fretje
Copy link
Contributor

fretje commented Feb 26, 2019

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?

@Metalnem
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants