Commit 3d1c0ac7 authored by Niels Möller's avatar Niels Möller
Browse files

* src/bignum.c (bignum_next_prime): Fixed off-by-one overflow.

Rev: src/bignum.c:1.13
parent 655e72fd
......@@ -287,7 +287,7 @@ bignum_next_prime(mpz_t p, mpz_t n, int count, int prime_limit)
if (prime_limit)
{
/* Compute residues modulo small odd primes */
moduli = (unsigned long*) alloca((prime_limit -1) * sizeof(*moduli));
moduli = (unsigned long*) alloca(prime_limit * sizeof(*moduli));
for (i = 0; i < prime_limit; i++)
moduli[i] = mpz_fdiv_ui(p, primes[i + 1]);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment