-
Notifications
You must be signed in to change notification settings - Fork 300
Closed
Description
The while loop on DocumentParser.java:480 doesn't correctly handle 0-length input documents. It will eventually cause an java.lang.ArrayIndexOutOfBoundsException in System.arrayCopy() a few levels down due to the return value from read(...) being -1. In truth any document where documentLength % 16384 == 0 will have this problem right now.
A if (charsRead < 0) break; statement after the read on line 481 will fix this.
If you need a test case you can simply run Parser.builder().build().parseReader(new StringReader(""));
Reactions are currently unavailable