You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the spec states the Will publish payload is binary data (max 65.535 bytes), so the client should check if I set a payload higher than that.
Actual behavior
It is possible to exceed the binary data limit if I create a Mqtt5Publish and extend it as will. This breaks the encoding of the Connect packet.
To Reproduce
Reproducer code
final @NotNull byte[] bytes = MqttCommonUtil.randomBytes(80_000);
//throws error because payload exceeds binary data length 65_535
// final Mqtt5WillPublish test = Mqtt5WillPublish.builder().topic("test").payload(bytes).build();
//doesn't throw error because payload is not treated as binary data
final Mqtt5Publish mqtt5Publish = Mqtt5Publish.builder().topic("test").payload(bytes).build();
final Mqtt5WillPublish test2 = mqtt5Publish.extend().asWill().delayInterval(10).build();
final Mqtt5AsyncClient retClient2 = Mqtt5Client.builder()
.identifier("retsub")
.simpleAuth().username("test").applySimpleAuth()
.willPublish(test2).buildAsync();
retClient2.connect().get();
Details
Affected HiveMQ MQTT Client version(s):
Used JVM version:
The text was updated successfully, but these errors were encountered:
Expected behavior
As the spec states the Will publish payload is binary data (max 65.535 bytes), so the client should check if I set a payload higher than that.
Actual behavior
It is possible to exceed the binary data limit if I create a Mqtt5Publish and extend it as will. This breaks the encoding of the Connect packet.
To Reproduce
Reproducer code
Details
The text was updated successfully, but these errors were encountered: