Github user mattyb149 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1389#discussion_r94650076
--- Diff:
nifi-commons/nifi-utils/src/main/java/org/apache/nifi/stream/io/util/TextLineDemarcator.java
---
@@ -159,8 +159,11 @@ private int isEol(byte currentByte, int currentIndex) {
this.index = currentIndex + 1;
this.fill();
}
- currentByte = this.buffer[currentIndex + 1];
- crlfLength = currentByte == '\n' ? 2 : 1;
+ crlfLength = 1;
+ if (this.bufferLength != -1) {
--- End diff --
After fill(), currentIndex can be equal to bufferLength - 1, so the next
line can still cause an AIOOBE
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---