summaryrefslogtreecommitdiffstats
path: root/crypto/jpake
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-11-04 15:51:02 +0000
committerMatt Caswell <matt@openssl.org>2015-11-09 22:54:19 +0000
commit903738ac63e60c10552741e2d6de9753c67e0ff3 (patch)
treee2e8b182c351cb41aa65e0cda6d15384223a1f94 /crypto/jpake
parenta89dda8cd024f53cbae75655e9ec000d9b4a320b (diff)
Fix missing malloc return value checks
During work on a larger change in master a number of locations were identified where return value checks were missing. This backports the relevant fixes. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/jpake')
-rw-r--r--crypto/jpake/jpake.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/jpake/jpake.c b/crypto/jpake/jpake.c
index 8c38727e20..ebc0975575 100644
--- a/crypto/jpake/jpake.c
+++ b/crypto/jpake/jpake.c
@@ -219,6 +219,9 @@ static int verify_zkp(const JPAKE_STEP_PART *p, const BIGNUM *zkpg,
BIGNUM *t3 = BN_new();
int ret = 0;
+ if (h == NULL || t1 == NULL || t2 == NULL || t3 == NULL)
+ goto end;
+
zkp_hash(h, zkpg, p, ctx->p.peer_name);
/* t1 = g^b */
@@ -234,6 +237,7 @@ static int verify_zkp(const JPAKE_STEP_PART *p, const BIGNUM *zkpg,
else
JPAKEerr(JPAKE_F_VERIFY_ZKP, JPAKE_R_ZKP_VERIFY_FAILED);
+end:
/* cleanup */
BN_free(t3);
BN_free(t2);