diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f8807e63..8b66b4ae3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## Commits to `main` ### Changes - - Add more checks for malformed packets when deserializing acknowledgments. + - [#159](https://github.com/FreeRTOS/coreMQTT/pull/159) Add more checks for malformed packets when deserializing acknowledgments. ## v1.1.1 (February 2021) diff --git a/source/core_mqtt_serializer.c b/source/core_mqtt_serializer.c index 7e8e30b45..ea466d00a 100644 --- a/source/core_mqtt_serializer.c +++ b/source/core_mqtt_serializer.c @@ -24,11 +24,9 @@ * @file core_mqtt_serializer.c * @brief Implements the user-facing functions in core_mqtt_serializer.h. */ -#include #include #include -#include "core_mqtt.h" #include "core_mqtt_serializer.h" /** @@ -1166,7 +1164,7 @@ static MQTTStatus_t deserializeSuback( const MQTTPacketInfo_t * pSuback, LogDebug( ( "Packet identifier %hu.", ( unsigned short ) *pPacketIdentifier ) ); - if( *pPacketIdentifier == MQTT_PACKET_ID_INVALID ) + if( *pPacketIdentifier == 0U ) { status = MQTTBadResponse; }