Skip to content

CsvReader.ReadNextRecord throws IndexOutOfRangeException #67

Description

@Metalnem

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.

Activity

  1. fretje commented on Feb 26, 2019

    @fretje
    Contributor

    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?

  2. Metalnem commented on Feb 27, 2019

    @Metalnem
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions