1
0
mirror of https://github.com/FreeRTOS/coreMQTT synced 2025-10-24 19:38:01 +08:00

Changes for passing the Coverity Static Analysis (#314)

<!--- Title -->

Description
-----------
<!--- Describe your changes in detail. -->
Make required changes for passing the Coverity Static Analysis. Unit
tests are modified for the changes made.

Checklist:
----------
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
- [x] I have tested my changes. No regression in existing tests.
- [x] I have modified and/or added unit-tests to cover the code changes
in this Pull Request.

Related Issue
-----------
<!-- If any, please provide issue ID. -->
By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: DakshitBabbar <ubuntu@ip-172-31-24-168.ap-south-1.compute.internal>
Co-authored-by: Dakshit Babbar <dakshba@amazon.com>
This commit is contained in:
Dakshit Babbar
2025-02-24 14:55:47 +05:30
committed by GitHub
parent 8dfeccb02a
commit 86a5750bb3
7 changed files with 158 additions and 79 deletions

View File

@@ -113,8 +113,8 @@ typedef void (* MQTTEventCallback_t )( struct MQTTContext * pContext,
*
* @param[in] pContext Initialised MQTT Context.
* @param[in] packetId Outgoing publish packet identifier.
* @param[in] pMqttVec Pointer to the opaque mqtt vector structure. Users should use MQTT_SerializeMQTTVec
* and MQTT_GetBytesInMQTTVec functions to get the memory required and to serialize the
* @param[in] pMqttVec Pointer to the opaque mqtt vector structure. Users should use MQTT_GetBytesInMQTTVec
* and MQTT_SerializeMQTTVec functions to get the memory required and to serialize the
* MQTTVec_t in the provided memory respectively.
*
* @return True if the copy is successful else false.
@@ -152,8 +152,6 @@ typedef bool ( * MQTTRetrievePacketForRetransmit)( struct MQTTContext * pContext
*
* @param[in] pContext Initialised MQTT Context.
* @param[in] packetId Copied publish packet identifier.
*
* @return True if the clear is successful else false.
*/
/* @[define_mqtt_retransmitclearpacket] */
typedef void (* MQTTClearPacketForRetransmit)( struct MQTTContext * pContext,
@@ -597,7 +595,7 @@ MQTTStatus_t MQTT_InitRetransmits( MQTTContext_t * pContext,
* @endcode
*/
/* @[declare_mqtt_checkconnectstatus] */
MQTTStatus_t MQTT_CheckConnectStatus( MQTTContext_t * pContext );
MQTTStatus_t MQTT_CheckConnectStatus( const MQTTContext_t * pContext );
/* @[declare_mqtt_checkconnectstatus] */
/**
@@ -1235,7 +1233,7 @@ const char * MQTT_Status_strerror( MQTTStatus_t status );
* @return The bytes in the provided #MQTTVec array which can then be used to set aside memory to be used with MQTT_SerializeMQTTVec( void * pAllocatedMem, MQTTVec_t *pVec ) function.
*/
/* @[declare_mqtt_getbytesinmqttvec] */
size_t MQTT_GetBytesInMQTTVec( MQTTVec_t * pVec );
size_t MQTT_GetBytesInMQTTVec( const MQTTVec_t * pVec );
/* @[declare_mqtt_getbytesinmqttvec] */
/**
@@ -1246,7 +1244,7 @@ size_t MQTT_GetBytesInMQTTVec( MQTTVec_t * pVec );
*/
/* @[declare_mqtt_serializemqttvec] */
void MQTT_SerializeMQTTVec( uint8_t * pAllocatedMem,
MQTTVec_t * pVec );
const MQTTVec_t * pVec );
/* @[declare_mqtt_serializemqttvec] */
/* *INDENT-OFF* */