mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8294593: Check the size of the target on invocations of BigInteger::isProbablePrime
Reviewed-by: darcy
This commit is contained in:
parent
a4f2078bd6
commit
081691adf4
2 changed files with 24 additions and 3 deletions
|
@ -3889,7 +3889,9 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
|
|||
return true;
|
||||
if (!w.testBit(0) || w.equals(ONE))
|
||||
return false;
|
||||
|
||||
if (w.bitLength() > PRIME_SEARCH_BIT_LENGTH_LIMIT + 1) {
|
||||
throw new ArithmeticException("Primality test implementation restriction on bitLength");
|
||||
}
|
||||
return w.primeToCertainty(certainty, null);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue