From d98a4b73664d0331f90da4f9521d7eea5f4567e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ulf=20M=C3=B6ller?= Date: Wed, 5 Sep 2001 04:43:43 +0000 Subject: [PATCH] bug fix: bn_sqr_recursive output is twice its input size. --- CHANGES | 3 +++ crypto/bn/bn_sqr.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index d7195d9007..db742fcb50 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,9 @@ *) applies to 0.9.6a/0.9.6b/0.9.6c and 0.9.7 +) applies to 0.9.7 only + *) BN_sqr() bug fix. + [Ulf Möller, reported by Jim Ellis ] + *) Make it possible to unload ranges of ERR strings with a new "ERR_unload_strings" function. [Geoff Thorpe] diff --git a/crypto/bn/bn_sqr.c b/crypto/bn/bn_sqr.c index b75e6194d0..c1d0cca438 100644 --- a/crypto/bn/bn_sqr.c +++ b/crypto/bn/bn_sqr.c @@ -245,7 +245,7 @@ void bn_sqr_recursive(BN_ULONG *r, const BN_ULONG *a, int n2, BN_ULONG *t) if (!zero) bn_sqr_recursive(&(t[n2]),t,n,p); else - memset(&(t[n2]),0,n*sizeof(BN_ULONG)); + memset(&(t[n2]),0,n2*sizeof(BN_ULONG)); bn_sqr_recursive(r,a,n,p); bn_sqr_recursive(&(r[n2]),&(a[n]),n,p); -- 2.34.1