Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] RECEIVE_MAXIMUM, TOPIC_ALIAS should be unsignedShort #1042

Open
2 of 3 tasks
DongyuanPan opened this issue Jul 1, 2024 · 0 comments
Open
2 of 3 tasks

[BUG] RECEIVE_MAXIMUM, TOPIC_ALIAS should be unsignedShort #1042

DongyuanPan opened this issue Jul 1, 2024 · 0 comments

Comments

@DongyuanPan
Copy link

Please fill out the form below before submitting, thank you!

  • Bug exists Release Version 1.2.5 ( Master Branch)
  • Bug exists in MQTTv3 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)
  • Bug exists in MQTTv5 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)

image
According to the MQTT 5.0 protocol, RECEIVE_MAXIMUM should be in the range [0, 65535], but when the property is resolved, readShort() is used, which causes the range to be [-32768, 32767].
For example, if the server sends 65535(0xFFFF), the parsing will overflow and RECEIVE_MAXIMUM will be -1.

TOPIC_ALIAS_MAXIMUM and TOPIC_ALIAS the same as RECEIVE_MAXIMUM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant