capnproto / capnproto-java

Cap'n Proto in pure Java
Other
391 stars 86 forks source link

Fix infinite loop in PackedInputStream when the supplied ArrayInputStream is smaller than needed #140

Closed mdindoffer closed 3 months ago

mdindoffer commented 3 months ago

Fix infinite loop in PackedInputStream when the supplied ArrayInputStream is smaller than the requested read length.

This seems to have been caused by ArrayInputStream not adhering to the contract of getReadBuffer() in the BufferedInputStream interface, thus the behaviour is different when calling SerializePacker.readFromUnbuffered() and SerializePacked.read().

Additionally:

dwrensha commented 3 months ago

Thanks!