Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
muneebahmed10 committed Apr 1, 2021
1 parent e5656b4 commit 856ecbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 1 addition & 3 deletions source/core_mqtt_serializer.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@
* @file core_mqtt_serializer.c
* @brief Implements the user-facing functions in core_mqtt_serializer.h.
*/
#include <cstdint>
#include <string.h>
#include <assert.h>

#include "core_mqtt.h"
#include "core_mqtt_serializer.h"

/**
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 856ecbd

Please sign in to comment.