#594 Websocket fails with small masked payloads

Documentation
closed
nobody
None
1
2012-11-18
2012-10-17
Steve Atkins
No

In 1.4.4 and 1.5.0 WebSocket::receiveBytes() fails for masked packets with payloads less than four bytes, This is not the same issue addressed in patch #112.

For a three byte payload, the first 5 bytes of the packet will be read into the header array. That leaves the fourth byte of the mask still available to be read from the stream, which leads to an off by one byte (or two, or three) error parsing this packet, leading to garbage in the returned payload, and failure to parse any later websocket packets (until the stream coincidentally resyncs).

Discussion

    • status: open --> pending
     
  • will be fixed in 1.4.5/1.5.1

     
    • status: pending --> closed