projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
90bdfd9
)
fix error found by coverity: check if ctx is != NULL before calling BN_CTX_end()
author
Nils Larsch
<nils@openssl.org>
Mon, 13 Mar 2006 23:14:57 +0000
(23:14 +0000)
committer
Nils Larsch
<nils@openssl.org>
Mon, 13 Mar 2006 23:14:57 +0000
(23:14 +0000)
crypto/dh/dh_key.c
patch
|
blob
|
history
crypto/ec/ec2_smpl.c
patch
|
blob
|
history
crypto/ec/ec_check.c
patch
|
blob
|
history
crypto/ec/ecp_smpl.c
patch
|
blob
|
history
crypto/rsa/rsa_gen.c
patch
|
blob
|
history
diff --git
a/crypto/dh/dh_key.c
b/crypto/dh/dh_key.c
index cc17c8851b691daf2798cad861f56b03adb9cbb1..79984e13bc927111d08b81ddb2b98a389f78356b 100644
(file)
--- a/
crypto/dh/dh_key.c
+++ b/
crypto/dh/dh_key.c
@@
-217,8
+217,11
@@
static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
ret=BN_bn2bin(tmp,key);
err:
- BN_CTX_end(ctx);
- BN_CTX_free(ctx);
+ if (ctx != NULL)
+ {
+ BN_CTX_end(ctx);
+ BN_CTX_free(ctx);
+ }
return(ret);
}
diff --git
a/crypto/ec/ec2_smpl.c
b/crypto/ec/ec2_smpl.c
index a2eb64859f2421839a599623eda50bc9cda7ef1c..527e6d81472103b9140a184f60028301d8309a3b 100644
(file)
--- a/
crypto/ec/ec2_smpl.c
+++ b/
crypto/ec/ec2_smpl.c
@@
-281,7
+281,8
@@
int ec_GF2m_simple_group_check_discriminant(const EC_GROUP *group, BN_CTX *ctx)
ret = 1;
err:
- BN_CTX_end(ctx);
+ if (ctx != NULL)
+ BN_CTX_end(ctx);
if (new_ctx != NULL)
BN_CTX_free(new_ctx);
return ret;
diff --git
a/crypto/ec/ec_check.c
b/crypto/ec/ec_check.c
index f22c5641a8177dc8bb3317a60a424230e00a8a12..0e316b4b3ff075234fcd62791d2995442710be01 100644
(file)
--- a/
crypto/ec/ec_check.c
+++ b/
crypto/ec/ec_check.c
@@
-113,7
+113,8
@@
int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx)
ret = 1;
err:
- BN_CTX_end(ctx);
+ if (ctx != NULL)
+ BN_CTX_end(ctx);
if (new_ctx != NULL)
BN_CTX_free(new_ctx);
if (point)
diff --git
a/crypto/ec/ecp_smpl.c
b/crypto/ec/ecp_smpl.c
index 75296a36733089fb555ed2bc703a044863e4c58d..4d26f8bdf6921f4ae9a9e5be06fbde3f54b55628 100644
(file)
--- a/
crypto/ec/ecp_smpl.c
+++ b/
crypto/ec/ecp_smpl.c
@@
-336,7
+336,8
@@
int ec_GFp_simple_group_check_discriminant(const EC_GROUP *group, BN_CTX *ctx)
ret = 1;
err:
- BN_CTX_end(ctx);
+ if (ctx != NULL)
+ BN_CTX_end(ctx);
if (new_ctx != NULL)
BN_CTX_free(new_ctx);
return ret;
diff --git
a/crypto/rsa/rsa_gen.c
b/crypto/rsa/rsa_gen.c
index 383d6095f57c989522d1aa6ec860d7f8a7f10173..742f8b18e5addabe76b5f67f07845eeac0b9a89a 100644
(file)
--- a/
crypto/rsa/rsa_gen.c
+++ b/
crypto/rsa/rsa_gen.c
@@
-183,8
+183,11
@@
err:
RSAerr(RSA_F_RSA_BUILTIN_KEYGEN,ERR_LIB_BN);
ok=0;
}
- BN_CTX_end(ctx);
- BN_CTX_free(ctx);
+ if (ctx != NULL)
+ {
+ BN_CTX_end(ctx);
+ BN_CTX_free(ctx);
+ }
return ok;
}