From 9f0928c6593f937a17b7974b04051c57e3874b20 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 12 Feb 2015 22:22:25 +0100 Subject: Update OpenSSL to AOSP -master --- main/openssl/crypto/ec/ec_mult.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'main/openssl/crypto/ec/ec_mult.c') diff --git a/main/openssl/crypto/ec/ec_mult.c b/main/openssl/crypto/ec/ec_mult.c index 19f21675..e81200b2 100644 --- a/main/openssl/crypto/ec/ec_mult.c +++ b/main/openssl/crypto/ec/ec_mult.c @@ -445,15 +445,16 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, wNAF_len = OPENSSL_malloc(totalnum * sizeof wNAF_len[0]); wNAF = OPENSSL_malloc((totalnum + 1) * sizeof wNAF[0]); /* includes space for pivot */ val_sub = OPENSSL_malloc(totalnum * sizeof val_sub[0]); - + + /* Ensure wNAF is initialised in case we end up going to err */ + if (wNAF) wNAF[0] = NULL; /* preliminary pivot */ + if (!wsize || !wNAF_len || !wNAF || !val_sub) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_MALLOC_FAILURE); goto err; } - wNAF[0] = NULL; /* preliminary pivot */ - /* num_val will be the total number of temporarily precomputed points */ num_val = 0; -- cgit v1.2.3