Uploaded image for project: 'Commons CSV'
  1. Commons CSV
  2. CSV-96

CSVRecord does not verify that the length of the header mapping matches the number of values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0
    • 1.0
    • Parser
    • None

    Description

      CSVRecord does not verify that the size of the header mapping matches the number of values. The following test will produce a ArrayOutOfBoundsException:

      @Test
      public void testInvalidHeaderTooLong() throws Exception {
         final CSVParser parser = new CSVParser("a,b", CSVFormat.newBuilder().withHeader("A", "B", "C").build());
         final CSVRecord record = parser.iterator().next();
         record.get("C");
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            britter Benedikt Ritter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: