From b35f242f5711d458646f6a950a02a39d99d3a8f7 Mon Sep 17 00:00:00 2001 From: "dongyuan.pdy" Date: Mon, 1 Jul 2024 16:42:30 +0800 Subject: [PATCH 1/2] bugfix: RECEIVE_MAXIMUM, TOPIC_ALIAS should be unsignedShort --- org.eclipse.paho.client.mqttv3.repository/pom.xml | 2 +- .../eclipse/paho/mqttv5/common/packet/MqttProperties.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/org.eclipse.paho.client.mqttv3.repository/pom.xml b/org.eclipse.paho.client.mqttv3.repository/pom.xml index d079ce389..d562382ca 100644 --- a/org.eclipse.paho.client.mqttv3.repository/pom.xml +++ b/org.eclipse.paho.client.mqttv3.repository/pom.xml @@ -1,4 +1,4 @@ - +origin 4.0.0 org.eclipse.paho 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..94330c98f 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,11 +470,11 @@ 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 = inputStream.readUnsignedShort(); } else if (identifier == TOPIC_ALIAS_MAXIMUM_IDENTIFIER) { - topicAliasMaximum = (int) inputStream.readShort(); + topicAliasMaximum = inputStream.readUnsignedShort(); } else if (identifier == TOPIC_ALIAS_IDENTIFIER) { - topicAlias = (int) inputStream.readShort(); + topicAlias = inputStream.readUnsignedShort(); } else if (identifier == MAXIMUM_QOS_IDENTIFIER) { maximumQoS = inputStream.read(); } else if (identifier == RETAIN_AVAILABLE_IDENTIFIER) { From 8a5abaa03503303fc70a1222178bd6064108bd88 Mon Sep 17 00:00:00 2001 From: "dongyuan.pdy" Date: Mon, 1 Jul 2024 16:55:20 +0800 Subject: [PATCH 2/2] bugfix: RECEIVE_MAXIMUM, TOPIC_ALIAS should be unsignedShort --- org.eclipse.paho.client.mqttv3.repository/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.eclipse.paho.client.mqttv3.repository/pom.xml b/org.eclipse.paho.client.mqttv3.repository/pom.xml index d562382ca..d079ce389 100644 --- a/org.eclipse.paho.client.mqttv3.repository/pom.xml +++ b/org.eclipse.paho.client.mqttv3.repository/pom.xml @@ -1,4 +1,4 @@ -origin + 4.0.0 org.eclipse.paho