From 8d5b6b1fc9701dcdc06bbdba2d541df7f7f1846e Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 1 Nov 2017 01:45:02 +0100 Subject: [PATCH] Leave and immediately reenter the critical section in sodium_misuse() Keep running everything in the critical section from there. --- src/libsodium/sodium/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libsodium/sodium/core.c b/src/libsodium/sodium/core.c index 8c500e80..d4303873 100644 --- a/src/libsodium/sodium/core.c +++ b/src/libsodium/sodium/core.c @@ -178,9 +178,10 @@ sodium_misuse(void) { void (*handler)(void); + sodium_crit_leave(); if (sodium_crit_enter() == 0) { handler = _misuse_handler; - if (sodium_crit_leave() == 0 && handler != NULL) { + if (handler != NULL) { handler(); } }