From cdd646bdac35373119c2db23e2739208ac55635d Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Sat, 22 Aug 2020 18:49:57 +0300 Subject: [PATCH] Fix Coverity #305798 --- test_tlstree.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test_tlstree.c b/test_tlstree.c index 5b847f5..1c4ecb8 100644 --- a/test_tlstree.c +++ b/test_tlstree.c @@ -101,7 +101,7 @@ int main(void) int i; OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL); - + memset(data63, 0, 4096); md = EVP_get_digestbynid(NID_grasshopper_mac); @@ -126,7 +126,10 @@ int main(void) ciph = EVP_get_cipherbynid(NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm); enc = EVP_CIPHER_CTX_new(); - EVP_EncryptInit_ex(enc, ciph, NULL, enc_key, full_iv); + if (EVP_EncryptInit_ex(enc, ciph, NULL, enc_key, full_iv) <= 0) { + fprintf(stderr, "Internal error"); + exit(1); + } for (i = 7; i >= 0; i--) { ++seq0[i]; -- 2.39.5