From 4be95d693825a78154d236f7097ddadec08a72e7 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Tue, 3 Oct 2023 20:44:46 +0000 Subject: [PATCH] crypto-nettle: Fix use after free --- src/crypto-nettle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto-nettle.c b/src/crypto-nettle.c index 9469539..5f1b0ef 100644 --- a/src/crypto-nettle.c +++ b/src/crypto-nettle.c @@ -634,9 +634,9 @@ bool crypto_rsa_priv_key_load(struct crypto_rsa_priv_key* priv, uint8_t* der = malloc(BASE64_DECODED_MAX_SIZE(base64_der.len)); assert(der); - vec_destroy(&base64_der); ssize_t der_len = base64_decode(der, base64_der.data); + vec_destroy(&base64_der); if (der_len < 0) { free(der); return false;