Visitar URL original
[3.10] gh-95778: CVE-2020-10735: Prevent DoS by very large int() by gpshead · Pull Request #96501 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc patch fixup & missing help text blank line.
  • Loading branch information
gpshead committed Aug 19, 2022
commit 0e84c7eb995207c1517633021088af36f3b3d35a
15 changes: 8 additions & 7 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,14 @@ are always available. They are listed here in alphabetical order.
.. versionchanged:: 3.8
Falls back to :meth:`__index__` if :meth:`__int__` is not defined.

.. versionchanged:: 3.10.7
:class:`int` string inputs and string representations can be limited to
help avoid denial of service attacks. A :exc:`ValueError` is raised when
the limit is exceeded while converting a string *x* to an :class:`int` or
when converting an :class:`int` into a string would exceed the limit.
See the :ref:`integer string conversion length limitation
<int_max_str_digits>` documentation.


.. function:: isinstance(object, classinfo)

Expand All @@ -907,13 +915,6 @@ are always available. They are listed here in alphabetical order.
.. versionchanged:: 3.10
*classinfo* can be a :ref:`types-union`.

.. versionchanged:: 3.10.7
:class:`int` string inputs and string representations can be limited to
help avoid denial of service attacks. A :exc:`ValueError` is raised when
the limit is exceeded while converting a string *x* to an :class:`int` or
when converting an :class:`int` into a string would exceed the limit.
See the :ref:`integer string conversion length limitation
<int_max_str_digits>` documentation.

.. function:: issubclass(class, classinfo)

Expand Down
1 change: 1 addition & 0 deletions Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ static const char usage_3[] = "\
-X int_max_str_digits=number: limit the size of int<->str conversions.\n\
This helps avoid denial of service attacks when parsing untrusted data.\n\
The default is sys.int_info.default_max_str_digits. 0 disables.\n\
\n\
--check-hash-based-pycs always|default|never:\n\
control how Python invalidates hash-based .pyc files\n\
";
Expand Down