From 0f9e3c5b335d3468070147f05f72458a5f4c2b5a Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 22 Feb 2019 13:17:43 -0500 Subject: [PATCH] fix crash if public key is null --- libi2pd/Signature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libi2pd/Signature.cpp b/libi2pd/Signature.cpp index c82c85df..986cd1ac 100644 --- a/libi2pd/Signature.cpp +++ b/libi2pd/Signature.cpp @@ -97,7 +97,7 @@ namespace crypto uint8_t publicKey[EDDSA25519_PUBLIC_KEY_LENGTH]; size_t len = EDDSA25519_PUBLIC_KEY_LENGTH; EVP_PKEY_get_raw_public_key (m_Pkey, publicKey, &len); - if (memcmp (publicKey, signingPublicKey, EDDSA25519_PUBLIC_KEY_LENGTH)) + if (signingPublicKey && memcmp (publicKey, signingPublicKey, EDDSA25519_PUBLIC_KEY_LENGTH)) { LogPrint (eLogWarning, "EdDSA public key mismatch. Fallback"); EVP_PKEY_free (m_Pkey);