bugfix: allocate sufficiently large buffer
authorBodo Möller <bodo@openssl.org>
Wed, 20 Feb 2002 11:59:42 +0000 (11:59 +0000)
committerBodo Möller <bodo@openssl.org>
Wed, 20 Feb 2002 11:59:42 +0000 (11:59 +0000)
Submitted by: Nils Larsch

crypto/ec/ec_mult.c

index f14f8d8..4e409d0 100644 (file)
@@ -233,7 +233,7 @@ int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
 
        wsize = OPENSSL_malloc(totalnum * sizeof wsize[0]);
        wNAF_len = OPENSSL_malloc(totalnum * sizeof wNAF_len[0]);
-       wNAF = OPENSSL_malloc(totalnum * sizeof wNAF[0] + 1);
+       wNAF = OPENSSL_malloc((totalnum + 1) * sizeof wNAF[0]);
        if (wNAF != NULL)
                {
                wNAF[0] = NULL; /* preliminary pivot */