capnproto / capnproto-java

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

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

Closed mdindoffer closed 5 months ago

mdindoffer commented 5 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 5 months ago

Thanks!