diff --git a/realalg/base_algebraic.py b/realalg/base_algebraic.py index ad4218e..8e9cc6f 100644 --- a/realalg/base_algebraic.py +++ b/realalg/base_algebraic.py @@ -6,6 +6,8 @@ from functools import total_ordering from math import log10 as log from numbers import Integral +import sys + import sympy as sp from .interval import Interval @@ -14,6 +16,12 @@ sp_QQ_x = sp.QQ.old_poly_ring(sp_x) LOG_2 = log(2) +# By default, Python will only convert a decimal string of length at +# most 4300 to an integer to protect against DDOS attacks; not relevant +# here (CVE-2020-10735). +if hasattr(sys, 'set_int_max_str_digits'): + sys.set_int_max_str_digits(0) + def log_plus(x): ''' Return the height of the number ``x``. ''' return log(max(1, abs(x)))