THausherr commented on pull request #107:
URL: https://github.com/apache/pdfbox/pull/107#issuecomment-997327723
I agree that the method is also flawed because the offset isn't set to the
starting point - 1 after a fail, but I doubt troubles would happen as long as
we only search for %%EOF and startxref.
```
RandomAccessRead source = new RandomAccessReadBuffer(new byte[0]);
PDFParser parser = new PDFParser(source, null, null, null, null);
byte [] buf = { '%', '%', '%', '%', 'E', 'O', 'F', 'O', 'F' };
int result = parser.lastIndexOf(EOF_MARKER, buf, buf.length);
System.out.println("result: " + result);
```
Can you come up with a failing test?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]