From 11e27d7af50f9661f22ec5076e3694f33811bdcb Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Wed, 20 Sep 2017 23:58:29 +0200 Subject: [PATCH] Add missing null checks in wallet/crypto_tests.cpp Align code with Bitcoin --- src/wallet/test/crypto_tests.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wallet/test/crypto_tests.cpp b/src/wallet/test/crypto_tests.cpp index 821522247..af93d0856 100644 --- a/src/wallet/test/crypto_tests.cpp +++ b/src/wallet/test/crypto_tests.cpp @@ -44,6 +44,8 @@ bool OldEncrypt(const CKeyingMaterial& vchPlaintext, std::vector EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); + if (!ctx) return false; + bool fOk = true; EVP_CIPHER_CTX_init(ctx); @@ -70,6 +72,8 @@ bool OldDecrypt(const std::vector& vchCiphertext, CKeyingMaterial EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); + if (!ctx) return false; + bool fOk = true; EVP_CIPHER_CTX_init(ctx);