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

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.0
    • Component/s: Parser
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: