fusesource / mqtt-client

A Java MQTT Client
http://mqtt-client.fusesource.org/
Apache License 2.0
1.27k stars 369 forks source link

UTF8 String decoding reads incorrect size value #60

Closed tabish121 closed 8 years ago

tabish121 commented 8 years ago

The MQTT spec defines the strings as UTF8 values encoded with a two byte length value with max size of 65535. The readUTF8 method in MessageSupport reads the value in as a short causes an IndexOutOfBoundsException if the string was larger 32767.

tabish121 commented 8 years ago

Reference String encodings in the spec: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718016