From 6f3aff5a40f3a9e249d3d36d0ce9a27a64a688a9 Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Sat, 22 Aug 2020 18:47:17 +0300 Subject: [PATCH] Fix coverity #305799 --- gost_ameth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gost_ameth.c b/gost_ameth.c index c31ef9a..4a95de4 100644 --- a/gost_ameth.c +++ b/gost_ameth.c @@ -973,7 +973,7 @@ static int pub_encode_gost_ec(X509_PUBKEY *pub, const EVP_PKEY *pk) pval = params; order = BN_new(); - if (!order) { + if (order == NULL || EC_GROUP_get_order(EC_KEY_get0_group(ec), order, NULL) == 0) { GOSTerr(GOST_F_PUB_ENCODE_GOST_EC, ERR_R_MALLOC_FAILURE); goto err; } -- 2.39.2