From: Dmitry Belyavskiy Date: Sun, 27 Sep 2020 08:11:51 +0000 (+0300) Subject: Fix Coverity #305799 X-Git-Tag: v3.0.0~61 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=6da0c1cd9f85cfd01983cf1bf779320474bef57d;p=openssl-gost%2Fengine.git Fix Coverity #305799 --- diff --git a/gost_ameth.c b/gost_ameth.c index 4a95de4..2582d63 100644 --- a/gost_ameth.c +++ b/gost_ameth.c @@ -977,7 +977,10 @@ static int pub_encode_gost_ec(X509_PUBKEY *pub, const EVP_PKEY *pk) GOSTerr(GOST_F_PUB_ENCODE_GOST_EC, ERR_R_MALLOC_FAILURE); goto err; } - EC_GROUP_get_order(EC_KEY_get0_group(ec), order, NULL); + if (EC_GROUP_get_order(EC_KEY_get0_group(ec), order, NULL) == 0) { + GOSTerr(GOST_F_PUB_ENCODE_GOST_EC, ERR_R_INTERNAL_ERROR); + goto err; + } pub_key = EC_KEY_get0_public_key(ec); if (!pub_key) { GOSTerr(GOST_F_PUB_ENCODE_GOST_EC, GOST_R_PUBLIC_KEY_UNDEFINED);