Skip to content

Commit

Permalink
Fix MISRA 9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
moninom1 committed Nov 29, 2023
1 parent aa25f93 commit 7c40f85
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions source/FreeRTOS_Sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -1926,8 +1926,16 @@ BaseType_t vSocketBind( FreeRTOS_Socket_t * pxSocket,
if( pxAddress == NULL )
{
pxAddress = &xAddress;
/* Put the port to zero to be assigned later. */
pxAddress->sin_port = 0U;
/* Clear the address: */
( void ) memset( pxAddress, 0, sizeof( struct freertos_sockaddr ) );
if( pxSocket->bits.bIsIPv6 == pdFALSE_UNSIGNED )
{
pxAddress->sin_family = FREERTOS_AF_INET6;
}
else
{
pxAddress->sin_family = FREERTOS_AF_INET;
}
}
}
#endif /* ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND == 1 */
Expand Down

0 comments on commit 7c40f85

Please sign in to comment.