From: Dmitry Belyavskiy Date: Sat, 22 Aug 2020 15:47:17 +0000 (+0300) Subject: Fix coverity #305799 X-Git-Tag: v3.0.0~71 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=6f3aff5a40f3a9e249d3d36d0ce9a27a64a688a9;p=openssl-gost%2Fengine.git Fix coverity #305799 --- 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; }