From 145fb9698929d247dffb35189397a3daff497431 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 5 Mar 2018 16:50:24 +0800 Subject: [PATCH] Don't read uninitialised value. From https://github.com/libtom/libtommath/commit/1d03522625f46214733e8e143a4765c01fc146f9 --- libtommath/bn_fast_s_mp_mul_digs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtommath/bn_fast_s_mp_mul_digs.c b/libtommath/bn_fast_s_mp_mul_digs.c index a1015af..783e7ca 100644 --- a/libtommath/bn_fast_s_mp_mul_digs.c +++ b/libtommath/bn_fast_s_mp_mul_digs.c @@ -87,7 +87,7 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) { mp_digit *tmpc; tmpc = c->dp; - for (ix = 0; ix < (pa + 1); ix++) { + for (ix = 0; ix < pa; ix++) { /* now extract the previous digit [below the carry] */ *tmpc++ = W[ix]; }