]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Fix coverity #305799
authorDmitry Belyavskiy <beldmit@gmail.com>
Sat, 22 Aug 2020 15:47:17 +0000 (18:47 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Sat, 22 Aug 2020 15:47:17 +0000 (18:47 +0300)
gost_ameth.c

index c31ef9a133ddd49d2c02843dfc51e0506a31ba76..4a95de4b5a203b13c32406abb6df7814f2756493 100644 (file)
@@ -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;
     }