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

ArrayIndexOutOfBoundsException when skipping empty lines, comments #191

Closed
f-julian opened this issue Apr 8, 2020 · 3 comments
Closed
Milestone

Comments

@f-julian
Copy link

f-julian commented Apr 8, 2020

Hi we found a bug in the csv parsing.

For some csv files parsing fails with:

java.lang.ArrayIndexOutOfBoundsException: Index 4000 out of bounds for length 4000 at com.fasterxml.jackson.dataformat.csv.impl.CsvDecoder.skipLinesWhenNeeded(CsvDecoder.java:527) at com.fasterxml.jackson.dataformat.csv.impl.CsvDecoder.startNewLine(CsvDecoder.java:499)

I did some digging it happens if there is a newline as char 4000 in the csv file.

Happens in versions > 2.10.0

I think it was introduced with #15

Can i help with a fix?

f-julian pushed a commit to f-julian/jackson-dataformats-text that referenced this issue Apr 8, 2020
added failing testcase
@f-julian
Copy link
Author

f-julian commented Apr 8, 2020

added failing testcase to reproduce the probem.

f-julian pushed a commit to f-julian/jackson-dataformats-text that referenced this issue Apr 8, 2020
added failing testcase
@cowtowncoder
Copy link
Member

@f-julian thank you for reporting the issue! Will have a look.

@cowtowncoder
Copy link
Member

Shoot. I really should have spent more time code reviewing that change (plus, should NOT have gone in a patch release). It assumes all content will reside in buffer, which is exactly what Jackson does not do or guarantee.

cowtowncoder added a commit that referenced this issue Apr 12, 2020
@cowtowncoder cowtowncoder added this to the 2.11.0 milestone Apr 15, 2020
@cowtowncoder cowtowncoder changed the title csv parsing - ArrayIndexOutOfBoundsException: Index 4000 ArrayIndexOutOfBoundsException when skipping empty lines, comments Apr 15, 2020
cowtowncoder added a commit that referenced this issue Apr 15, 2020
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