Skip to content

Commit a852c5f

Browse files
gpsheaducodery
andauthored
[3.11] Correct CVE-2020-10735 documentation (GH-100306). (#100476)
(cherry picked from commit 1cf3d78) Co-authored-by: Jeremy Paige <ucodery@gmail.com>
1 parent 9477594 commit a852c5f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Doc/library/stdtypes.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -5476,7 +5476,7 @@ to mitigate denial of service attacks. This limit *only* applies to decimal or
54765476
other non-power-of-two number bases. Hexadecimal, octal, and binary conversions
54775477
are unlimited. The limit can be configured.
54785478

5479-
The :class:`int` type in CPython is an abitrary length number stored in binary
5479+
The :class:`int` type in CPython is an arbitrary length number stored in binary
54805480
form (commonly known as a "bignum"). There exists no algorithm that can convert
54815481
a string to a binary integer or a binary integer to a string in linear time,
54825482
*unless* the base is a power of 2. Even the best known algorithms for base 10
@@ -5540,7 +5540,7 @@ and :class:`str` or :class:`bytes`:
55405540
* ``int(string)`` with default base 10.
55415541
* ``int(string, base)`` for all bases that are not a power of 2.
55425542
* ``str(integer)``.
5543-
* ``repr(integer)``
5543+
* ``repr(integer)``.
55445544
* any other string conversion to base 10, for example ``f"{integer}"``,
55455545
``"{}".format(integer)``, or ``b"%d" % integer``.
55465546

@@ -5568,7 +5568,7 @@ command line flag to configure the limit:
55685568
:envvar:`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`.
55695569
If both the env var and the ``-X`` option are set, the ``-X`` option takes
55705570
precedence. A value of *-1* indicates that both were unset, thus a value of
5571-
:data:`sys.int_info.default_max_str_digits` was used during initilization.
5571+
:data:`sys.int_info.default_max_str_digits` was used during initialization.
55725572

55735573
From code, you can inspect the current limit and set a new one using these
55745574
:mod:`sys` APIs:

Python/clinic/sysmodule.c.h

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/sysmodule.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1627,12 +1627,12 @@ sys_mdebug_impl(PyObject *module, int flag)
16271627
/*[clinic input]
16281628
sys.get_int_max_str_digits
16291629
1630-
Set the maximum string digits limit for non-binary int<->str conversions.
1630+
Return the maximum string digits limit for non-binary int<->str conversions.
16311631
[clinic start generated code]*/
16321632

16331633
static PyObject *
16341634
sys_get_int_max_str_digits_impl(PyObject *module)
1635-
/*[clinic end generated code: output=0042f5e8ae0e8631 input=8dab13e2023e60d5]*/
1635+
/*[clinic end generated code: output=0042f5e8ae0e8631 input=61bf9f99bc8b112d]*/
16361636
{
16371637
PyInterpreterState *interp = _PyInterpreterState_GET();
16381638
return PyLong_FromSsize_t(interp->int_max_str_digits);

0 commit comments

Comments
 (0)