Skip to content

Commit

Permalink
* FIX [mqtt_codec] Fix the wrong length in decoding publish packet.
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghaEMQ authored and JaylinYu committed Mar 31, 2023
1 parent a00b2a5 commit 0a0d8e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/supplemental/mqtt/mqtt_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2221,7 +2221,7 @@ nni_mqttv5_msg_decode_publish(nni_msg *msg)
a PUBLISH Packet to contain a zero length payload.*/
mqtt->payload.publish.payload.length =
mqtt->fixed_header.remaining_length -
(2 /* Length bytes of Topic Name */ +
(2 /* Length bytes of Topic Name */ + 1 + prop_len +
mqtt->var_header.publish.topic_name.length + packid_length);
mqtt->payload.publish.payload.buf =
(mqtt->payload.publish.payload.length > 0) ? buf.curpos : NULL;
Expand Down

0 comments on commit 0a0d8e7

Please sign in to comment.