Fix undefined behavior in mbedTLS transport log format specifiers (#1406)

* Fix undefined behavior in mbedTLS transport log statements

* pNetworkContext now explicitly cast to void pointer

* Delete personal fil
This commit is contained in:
Aniruddha Joshi
2026-04-27 17:13:58 -04:00
committed by GitHub
parent e6af9f22e5
commit b72aef2d31
2 changed files with 4 additions and 4 deletions

View File

@@ -659,7 +659,7 @@ static TlsTransportStatus_t initMbedtls( mbedtls_entropy_context * pEntropyConte
if( mbedtlsError != PSA_SUCCESS )
{
LogError( ( "Failed to initialize PSA Crypto implementation: %s", ( int ) mbedtlsError ) );
LogError( ( "Failed to initialize PSA Crypto implementation: %d", ( int ) mbedtlsError ) );
returnStatus = TLS_TRANSPORT_INTERNAL_ERROR;
}
}
@@ -832,8 +832,8 @@ void TLS_FreeRTOS_Disconnect( NetworkContext_t * pNetworkContext )
/* WANT_READ and WANT_WRITE can be ignored. Logging for debugging purposes. */
LogInfo( ( "(Network connection %p) TLS close-notify sent; "
"received %s as the TLS status can be ignored for close-notify.",
( tlsStatus == MBEDTLS_ERR_SSL_WANT_READ ) ? "WANT_READ" : "WANT_WRITE",
pNetworkContext ) );
( void * ) pNetworkContext,
( tlsStatus == MBEDTLS_ERR_SSL_WANT_READ ) ? "WANT_READ" : "WANT_WRITE" ) );
}
/* Call socket shutdown function to close connection. */

View File

@@ -320,7 +320,7 @@ static TlsTransportStatus_t tlsSetup( NetworkContext_t * pNetworkContext,
if( mbedtlsError != PSA_SUCCESS )
{
LogError( ( "Failed to initialize PSA Crypto implementation: %s", ( int ) mbedtlsError ) );
LogError( ( "Failed to initialize PSA Crypto implementation: %d", ( int ) mbedtlsError ) );
returnStatus = TLS_TRANSPORT_INVALID_PARAMETER;
}
else