Conversation
There was a problem hiding this comment.
Pull request overview
This PR delivers a batch of targeted robustness and correctness fixes across MQTT-SN, MQTT v5 property encoding, client response lifecycle handling, and broker-side safety checks.
Changes:
- Adds additional length/overflow guards in MQTT-SN packet encoders/decoders and MQTT v5 property encoding.
- Fixes several client/broker correctness issues (pending response cleanup, packet-id wrap handling, debug message type, constant-time compare portability).
- Improves broker-side bounds handling and sensitive-data cleanup (force-zero before free, static-mem length rejection).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| wolfmqtt/mqtt_sn_packet.h | Introduces SN_PACKET_MAX_LEN (0xFFFF) to bound MQTT-SN packet lengths. |
| src/mqtt_sn_packet.c | Uses word16 for decoded lengths and enforces max-length checks in multiple MQTT-SN encoders. |
| src/mqtt_sn_client.c | Fixes pending response cleanup on connect failure, corrects a debug print, and conditions disconnect pendResp handling on sleep timer usage. |
| src/mqtt_packet.c | Adds property-list corruption guards and remaining-length bounds checks; adds a publish payload/buffer size check. |
| src/mqtt_client.c | Fixes pending-response list removal loop safety during net disconnect. |
| src/mqtt_broker.c | Improves constant-time compare portability, adds stricter static-mem length checks, enforces out-of-buffer errors instead of truncation in select paths, and force-zeros sensitive data on free. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #478
Scan targets checked: wolfmqtt-bugs, wolfmqtt-src
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
Fix F-1171 SN_Client_Disconnect_ex check disconnect
Fix F-1172 SN_Client_Connect clean
Fix F-1595 use word16 instead of int
Fix F-1601 check total_len against word16 max
Fix F-1174 and F-1175 use force zero
Fix F-1173 SN_Client_WillMsgUpdate debug message
Fix F-1596 BrokerHandle_Connect packet ID calc
Fix F-1597 MqttClient_NetDisconnect resp list cleanup
Fix F-1176 BrokerStrCompare portable constant-time compare
Fix F-1603 static-mem broker check len
Fix F-1604 MqttEncode_Props check max props
Fix F-1606 BrokerHandle_Connect static-mem error codes