From c2c90031ecd3c1a26369ad89b99fad3264542ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 15 Jul 2013 11:04:58 +0200 Subject: [PATCH] Fix pk_set_type() behaviour for unkown type --- library/pk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/pk.c b/library/pk.c index 18db95ade..78ff5e97c 100644 --- a/library/pk.c +++ b/library/pk.c @@ -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 );