fix:fixed crash issues when the illegal topic is received #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在大量压测中,设备建立mqtt连接之后,偶现收到下行异常主题(出现异常主题原因我怀疑时,socket读取到异常消息所致),概率出现crash问题。
原因:
line56中,if条件语句为真,即异常exit,返回值理应为error(0)。但实际返回值却可能会被line53行修改为了1。
此时调用MQTTDeserialize_publish接口的逻辑,可能会因为payload为空,及payloadlen为0,产生非法地址访问。