Skip to content

Reject negative skips before changing reader state - #10

Merged
vigna merged 1 commit into
vigna:masterfrom
PHJ2000:fix-negative-reader-skip
Oct 5, 2026
Merged

vigna merged 1 commit into
vigna:masterfrom
PHJ2000:fix-negative-reader-skip

Conversation

@PHJ2000

@PHJ2000 PHJ2000 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Reject negative skip counts before modifying FastBufferedReader's buffer position. Add tests for a negative skip before the first read and for preserving the position after a rejected skip with buffered data.

Validation: the Ant junit target passed on Java 21, compiling with the project's --release 8 setting (474 tests, no failures or errors, 5 skipped). Dependencies were resolved through Ivy. Both added tests fail on the unmodified implementation.

Fixes #9.

@vigna
vigna merged commit 9d32ae4 into vigna:master Oct 5, 2026
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

Successfully merging this pull request may close these issues.

FastBufferedReader.skip accepts negative counts and corrupts its position

2 participants