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

ProtoReader#readVarint64 can throw an IllegalStateException #627

Closed
swankjesse opened this issue Sep 3, 2016 · 1 comment
Closed

ProtoReader#readVarint64 can throw an IllegalStateException #627

swankjesse opened this issue Sep 3, 2016 · 1 comment

Comments

@swankjesse
Copy link
Member

It needs to defend against the input stream being exhausted.

java.lang.IllegalStateException: size == 0
    at okio.Buffer.readByte(Buffer.java:273)
    at com.squareup.wire.ProtoReader.readVarint64(ProtoReader.java:330)
@JakeWharton
Copy link
Member

I noticed this a long time ago but hoped it would never happen in practice 😶

Easy workaround is to re-buffer via Okio.buffer so you get checked behavior vs unchecked.

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