Fixes for various fenrir issues#473
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses a set of MQTT v5 and MQTT-SN correctness/stability issues (buffer validation, non-blocking read behavior, error propagation, and property init/shutdown documentation).
Changes:
- Add/clarify thread-safety documentation for MQTT v5 property init/shutdown APIs.
- Harden multiple MQTT-SN decode paths with additional bounds checks and fix decode/encode edge cases (topic id access, publish length calc, subscribe-ack error code).
- Fix MQTT v5 AUTH decode logic and ensure early return on write failures in MQTT-SN client flows.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| wolfmqtt/mqtt_packet.h | Documents single-thread init/shutdown requirements for MQTT v5 property APIs. |
| src/mqtt_sn_packet.c | Adds bounds checks to MQTT-SN decoders and fixes publish encoding/length and packet read behavior. |
| src/mqtt_sn_client.c | Returns immediately on packet write failure in several MQTT-SN client operations. |
| src/mqtt_packet.c | Fixes MQTT v5 AUTH decoding behavior and documents property init/shutdown semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
This reverts commit fe6666b.
There was a problem hiding this comment.
Pull request overview
This PR applies a set of targeted fixes across MQTT-SN and MQTT v5 AUTH/property handling, addressing multiple fenrir-reported issues and improving robustness around packet decoding and non-blocking I/O paths.
Changes:
- Add thread-usage documentation for MQTT v5 property init/shutdown APIs.
- Harden MQTT-SN decoders (length checks, correct error codes, safer topic-id access, publish length calculation).
- Adjust MQTT-SN packet read logic and MQTT v5 AUTH decode behavior (including Remaining Length = 0 semantics).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| wolfmqtt/mqtt_packet.h | Documents required single-thread init/shutdown semantics for MQTT v5 property helpers. |
| src/mqtt_sn_packet.c | Adds MQTT-SN decode bounds checks and refactors publish decode and packet read logic. |
| src/mqtt_sn_client.c | Ensures early returns on MqttPacket_Write failure in selected SN client operations. |
| src/mqtt_packet.c | Fixes MQTT v5 AUTH decode semantics and adds property init/shutdown comments in implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Fixes for: