I fixed a crash that occurred when a 'ConnectReturnCode' of 7 or higher was received.
If a ConnectReturnCode of 7 or higher is received, the returnCode of FrameConnAck becomes nil, which is a crash caused by incorrect access to the returnCode afterward.
I fixed a crash that occurred when a 'ConnectReturnCode' of 7 or higher was received.
If a
ConnectReturnCode
of 7 or higher is received, thereturnCode
of FrameConnAck becomes nil, which is a crash caused by incorrect access to thereturnCode
afterward.https://github.com/emqx/CocoaMQTT/blob/1d53567bee10083c72a8f6155ccd837d686898cd/Source/CocoaMQTT.swift#L15-L23
https://github.com/emqx/CocoaMQTT/blob/1d53567bee10083c72a8f6155ccd837d686898cd/Source/FrameConnAck.swift#L97-L98
https://github.com/emqx/CocoaMQTT/blob/1d53567bee10083c72a8f6155ccd837d686898cd/Source/CocoaMQTT.swift#L666
For this reason, the code has been modified so that
ConnectReturnCode
in 7-255 can also be initialized as reserved.This is also a correct implementation according to the MQTT specification.
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Table_3.1_-