diff options
Diffstat (limited to 'mpi/mpi.c')
-rw-r--r-- | mpi/mpi.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2781,7 +2781,7 @@ mp_err mp_bit(mp_int *a, mp_digit bit) a = &tmp; } - return (DIGITS(a)[digit] & mask) != 0 ? MP_YES : MP_NO; + return (digit < USED(a) && (DIGITS(a)[digit] & mask) != 0) ? MP_YES : MP_NO; } mp_err mp_to_double(mp_int *mp, double *d) |