Skip to content

Commit 1ea152e

Browse files
committed
Fix for continue during variable part of the header. A continue in the middle of variable would not correctly process for large messages.
1 parent 53d541f commit 1ea152e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mqtt_packet.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,7 @@ int MqttPacket_Read(MqttClient *client, byte* rx_buf, int rx_buf_len,
19841984
int i;
19851985
client->packet.stat = MQTT_PK_READ_HEAD;
19861986

1987-
for (i = 0; i < MQTT_PACKET_MAX_LEN_BYTES; i++) {
1987+
for (i = client->packet.header_len; i < MQTT_PACKET_MAX_LEN_BYTES; i++) {
19881988
/* Check if another byte is needed */
19891989
if ((header->len[i] & MQTT_PACKET_LEN_ENCODE_MASK) == 0) {
19901990
/* Variable byte length can be determined */

0 commit comments

Comments
 (0)