avoid access uninitialised memory, found by gcc8, patch by agc@.
This commit is contained in:
parent
a83f6c1317
commit
d6b33fe60a
@ -2308,7 +2308,7 @@ fast_col_array_multiply(mp_int * a, mp_int * b, mp_int * c, int digs)
|
||||
tmpc = c->dp;
|
||||
for (ix = 0; ix < pa+1; ix++) {
|
||||
/* now extract the previous digit [below the carry] */
|
||||
*tmpc++ = W[ix];
|
||||
*tmpc++ = (ix < pa) ? W[ix] : 0;
|
||||
}
|
||||
|
||||
/* clear unused digits [that existed in the old copy of c] */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bignum.c,v 1.2 2018/02/08 09:05:17 dholland Exp $ */
|
||||
/* $NetBSD: bignum.c,v 1.3 2019/10/04 09:16:38 mrg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2012 Alistair Crooks <agc@NetBSD.org>
|
||||
@ -2304,7 +2304,7 @@ fast_col_array_multiply(mp_int * a, mp_int * b, mp_int * c, int digs)
|
||||
tmpc = c->dp;
|
||||
for (ix = 0; ix < pa+1; ix++) {
|
||||
/* now extract the previous digit [below the carry] */
|
||||
*tmpc++ = W[ix];
|
||||
*tmpc++ = (ix < pa) ? W[ix] : 0;
|
||||
}
|
||||
|
||||
/* clear unused digits [that existed in the old copy of c] */
|
||||
|
Loading…
Reference in New Issue
Block a user