mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-16 08:56:51 +01:00
BugFix: MQTTSNDeserialize_XXXX() functions don't return error code when
error occurs. Do not store the length of packet into rc. If the packet is incorrect, skip the processing that follows. Bugfix: Print out the value of TopicId in SUBACK and UNSUBACK. Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
@@ -200,7 +200,7 @@ int MQTTSNDeserialize_pingresp(unsigned char* buf, int buflen)
|
||||
int mylen;
|
||||
|
||||
FUNC_ENTRY;
|
||||
curdata += (rc = MQTTSNPacket_decode(curdata, buflen, &mylen)); /* read length */
|
||||
curdata += MQTTSNPacket_decode(curdata, buflen, &mylen); /* read length */
|
||||
enddata = buf + mylen;
|
||||
if (enddata - curdata < 2)
|
||||
goto exit;
|
||||
@@ -428,7 +428,7 @@ int MQTTSNDeserialize_willtopicresp(int* resp_rc, unsigned char* buf, int buflen
|
||||
int mylen;
|
||||
|
||||
FUNC_ENTRY;
|
||||
curdata += (rc = MQTTSNPacket_decode(curdata, buflen, &mylen)); /* read length */
|
||||
curdata += MQTTSNPacket_decode(curdata, buflen, &mylen); /* read length */
|
||||
enddata = buf + mylen;
|
||||
if (enddata - buf < 3)
|
||||
goto exit;
|
||||
@@ -460,7 +460,7 @@ int MQTTSNDeserialize_willmsgresp(int* resp_rc, unsigned char* buf, int buflen)
|
||||
int mylen;
|
||||
|
||||
FUNC_ENTRY;
|
||||
curdata += (rc = MQTTSNPacket_decode(curdata, buflen, &mylen)); /* read length */
|
||||
curdata += MQTTSNPacket_decode(curdata, buflen, &mylen); /* read length */
|
||||
enddata = buf + mylen;
|
||||
if (enddata - buf < 3)
|
||||
goto exit;
|
||||
|
||||
Reference in New Issue
Block a user