mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2026-07-30 09:43:45 +00:00
Port CBMC recognized undefined behavior fixes from C-SDK v4_beta (#157)
This commit is contained in:
@@ -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 )
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user