diff --git a/org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/common/packet/MqttProperties.java b/org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/common/packet/MqttProperties.java index 5b2c09e32..af415f204 100644 --- a/org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/common/packet/MqttProperties.java +++ b/org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/common/packet/MqttProperties.java @@ -470,7 +470,7 @@ public void decodeProperties(DataInputStream dis) throws IOException, MqttExcept } else if (identifier == REASON_STRING_IDENTIFIER) { reasonString = MqttDataTypes.decodeUTF8(inputStream); } else if (identifier == RECEIVE_MAXIMUM_IDENTIFIER) { - receiveMaximum = (int) inputStream.readShort(); + receiveMaximum = (int) inputStream.readUnsignedShort(); } else if (identifier == TOPIC_ALIAS_MAXIMUM_IDENTIFIER) { topicAliasMaximum = (int) inputStream.readShort(); } else if (identifier == TOPIC_ALIAS_IDENTIFIER) {