From 638fa0bb0f0b061f259f8ec49dd75993c9c17a97 Mon Sep 17 00:00:00 2001 From: ptahpeteh Date: Mon, 1 Jun 2015 12:28:29 +0200 Subject: [PATCH] Serious bug fix in entropy.c Bug: mutex access within entropy_contex after it has been zeroed leads to app crash. --- library/entropy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/entropy.c b/library/entropy.c index c90c7e462..540a27c57 100644 --- a/library/entropy.c +++ b/library/entropy.c @@ -94,10 +94,10 @@ void entropy_free( entropy_context *ctx ) #if defined(POLARSSL_HAVEGE_C) havege_free( &ctx->havege_data ); #endif - polarssl_zeroize( ctx, sizeof( entropy_context ) ); #if defined(POLARSSL_THREADING_C) polarssl_mutex_free( &ctx->mutex ); #endif + polarssl_zeroize( ctx, sizeof( entropy_context ) ); } int entropy_add_source( entropy_context *ctx,