Port CBMC recognized undefined behavior fixes from C-SDK v4_beta (#157)

This commit is contained in:
Archit Aggarwal
2020-07-21 17:01:00 -07:00
committed by GitHub
parent 274a6c331d
commit fce6ec479d
2 changed files with 14 additions and 6 deletions

View File

@@ -668,11 +668,18 @@ bool IotMqtt_IsSubscribed( IotMqttConnection_t mqttConnection,
* function is running. */
IotMutex_Lock( &( mqttConnection->subscriptionMutex ) );
/* Search for a matching subscription. */
pSubscriptionLink = IotListDouble_FindFirstMatch( &( mqttConnection->subscriptionList ),
NULL,
_topicMatch,
&topicMatchParams );
if( pTopicFilter == NULL )
{
IotLogError( "Topic filter must be set." );
}
else
{
/* Search for a matching subscription. */
pSubscriptionLink = IotListDouble_FindFirstMatch( &( mqttConnection->subscriptionList ),
NULL,
_topicMatch,
&topicMatchParams );
}
/* Check if a matching subscription was found. */
if( pSubscriptionLink != NULL )

View File

@@ -619,7 +619,8 @@ bool _IotMqtt_ValidateConnect( const IotMqttConnectInfo_t * pConnectInfo )
/* If will info is provided, check that it is valid. */
if( pConnectInfo->pWillInfo != NULL )
{
status = _IotMqtt_ValidateLwtPublish( pConnectInfo->awsIotMqttMode,
status = ( pConnectInfo->pWillInfo->pPayload != NULL ) &&
_IotMqtt_ValidateLwtPublish( pConnectInfo->awsIotMqttMode,
pConnectInfo->pWillInfo );
}
}