babl-ws / babl

Low-latency WebSocket Server
https://babl.ws
Apache License 2.0
68 stars 22 forks source link

FrameDecoder doesn't handle medium-sized frames properly #97

Open Crokoking opened 2 years ago

Crokoking commented 2 years ago

When FrameDecoder determines the size of a medium-sized payload it uses Integer.toUnsignedLong() instead of Short.toUnsignedLong() potentially causing negative payload sizes and essentially breaking the connection.

epickrram commented 2 years ago

Hi, thanks for the report. We'll look at this when possible. In the mean time, feel free to submit a PR containing a fix.