1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-12-24 17:41:01 +03:00

Fix pk_set_type() behaviour for unkown type

This commit is contained in:
Manuel Pégourié-Gonnard
2013-07-15 11:04:58 +02:00
committed by Paul Bakker
parent 14d8564402
commit c2c90031ec

View File

@@ -114,7 +114,7 @@ int pk_set_type( pk_context *ctx, pk_type_t type )
size = sizeof( ecdsa_context );
else
#endif
size = 0; /* should never be executed */
return( POLARSSL_ERR_PK_TYPE_MISMATCH );
if( ( ctx->data = malloc( size ) ) == NULL )
return( POLARSSL_ERR_PK_MALLOC_FAILED );