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

Lead Exception #16

Closed
bradsdavis opened this issue Sep 26, 2012 · 2 comments
Closed

Lead Exception #16

bradsdavis opened this issue Sep 26, 2012 · 2 comments

Comments

@bradsdavis
Copy link

Exception running against RPM.

Exception in thread "main" java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:472)
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:117)
at org.freecompany.redline.header.Lead.read(Lead.java:72)
at org.freecompany.redline.Scanner.run(Scanner.java:75)
at org.freecompany.redline.Scanner.main(Scanner.java:43)

The issue was on line 73 of Lead.java.

while (((b = data.get()) != 0)) builder.append(( char) b);

Needed to become:

while ((data.hasRemaining() && (b = data.get()) != 0)) builder.append(( char) b);

@craigwblake
Copy link
Owner

Thanks for finding this, I'll review and apply the fix as soon as possible.

@craigwblake
Copy link
Owner

Fix applied in commit f113364

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