@@ -73,11 +73,7 @@ static CellularError_t _socketSetSockOptLevelTransport( CellularSocketOption_t o
7373 {
7474 if ( optionValueLength == sizeof ( uint32_t ) )
7575 {
76- /* MISRA Ref 11.3 [Misaligned access] */
77- /* More details at: https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/blob/main/MISRA.md#rule-113 */
78- /* coverity[misra_c_2012_rule_11_3_violation] */
79- pTimeoutMs = ( const uint32_t * ) pOptionValue ;
80- socketHandle -> sendTimeoutMs = * pTimeoutMs ;
76+ ( void ) memcpy ( & ( socketHandle -> sendTimeoutMs ), pOptionValue , sizeof ( uint32_t ) );
8177 }
8278 else
8379 {
@@ -88,11 +84,8 @@ static CellularError_t _socketSetSockOptLevelTransport( CellularSocketOption_t o
8884 {
8985 if ( optionValueLength == sizeof ( uint32_t ) )
9086 {
91- /* MISRA Ref 11.3 [Misaligned access] */
92- /* More details at: https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/blob/main/MISRA.md#rule-113 */
93- /* coverity[misra_c_2012_rule_11_3_violation] */
94- pTimeoutMs = ( const uint32_t * ) pOptionValue ;
95- socketHandle -> recvTimeoutMs = * pTimeoutMs ;
87+ ( void ) memcpy ( & ( socketHandle -> recvTimeoutMs ), pOptionValue , sizeof ( uint32_t ) );
88+
9689 }
9790 else
9891 {
@@ -116,10 +109,7 @@ static CellularError_t _socketSetSockOptLevelTransport( CellularSocketOption_t o
116109 {
117110 if ( ( socketHandle -> socketState == SOCKETSTATE_ALLOCATED ) && ( optionValueLength == sizeof ( uint16_t ) ) )
118111 {
119- /* MISRA Ref 11.3 [Misaligned access] */
120- /* More details at: https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface/blob/main/MISRA.md#rule-113 */
121- /* coverity[misra_c_2012_rule_11_3_violation] */
122- socketHandle -> localPort = * ( ( uint16_t * ) pOptionValue );
112+ ( void ) memcpy ( & ( socketHandle -> localPort ), pOptionValue , sizeof ( uint16_t ) );
123113 }
124114 else
125115 {
0 commit comments