projects
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1f6e9bc
)
Check for NULL before use (Coverity ID 203).
author
Ben Laurie
<ben@openssl.org>
Sat, 13 Dec 2008 17:28:25 +0000
(17:28 +0000)
committer
Ben Laurie
<ben@openssl.org>
Sat, 13 Dec 2008 17:28:25 +0000
(17:28 +0000)
engines/ccgost/gost_ameth.c
patch
|
blob
|
history
diff --git
a/engines/ccgost/gost_ameth.c
b/engines/ccgost/gost_ameth.c
index
0a89603
..
b9d9ba7
100644
(file)
--- a/
engines/ccgost/gost_ameth.c
+++ b/
engines/ccgost/gost_ameth.c
@@
-415,20
+415,21
@@
static int print_gost_01(BIO *out, const EVP_PKEY *pkey, int indent,
BN_print(out,key);
BIO_printf(out,"\n");
}
BN_print(out,key);
BIO_printf(out,"\n");
}
- if (type >=1)
+ if (type >=
1)
{
BN_CTX *ctx = BN_CTX_new();
BIGNUM *X,*Y;
const EC_POINT *pubkey;
const EC_GROUP *group;
{
BN_CTX *ctx = BN_CTX_new();
BIGNUM *X,*Y;
const EC_POINT *pubkey;
const EC_GROUP *group;
- BN_CTX_start(ctx);
- X= BN_CTX_get(ctx);
- Y=BN_CTX_get(ctx);
+
if (!ctx)
{
GOSTerr(GOST_F_PRINT_GOST_01,ERR_R_MALLOC_FAILURE);
return 0;
}
if (!ctx)
{
GOSTerr(GOST_F_PRINT_GOST_01,ERR_R_MALLOC_FAILURE);
return 0;
}
+ BN_CTX_start(ctx);
+ X = BN_CTX_get(ctx);
+ Y = BN_CTX_get(ctx);
pubkey = EC_KEY_get0_public_key((EC_KEY *)EVP_PKEY_get0((EVP_PKEY *)pkey));
group = EC_KEY_get0_group((EC_KEY *)EVP_PKEY_get0((EVP_PKEY *)pkey));
if (!EC_POINT_get_affine_coordinates_GFp(group,pubkey,X,Y,ctx))
pubkey = EC_KEY_get0_public_key((EC_KEY *)EVP_PKEY_get0((EVP_PKEY *)pkey));
group = EC_KEY_get0_group((EC_KEY *)EVP_PKEY_get0((EVP_PKEY *)pkey));
if (!EC_POINT_get_affine_coordinates_GFp(group,pubkey,X,Y,ctx))