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:
tomoaki
2017-05-19 09:44:51 +09:00
parent 1b867589e5
commit 5c278f1aec
14 changed files with 64 additions and 43 deletions

View File

@@ -68,7 +68,7 @@ int MQTTSNDeserialize_searchgw(unsigned char* radius, unsigned char* buf, int bu
int mylen = 0;
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 > buflen)
goto exit;