summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.8.14v3.8.14Łukasz Langa2022-09-061-2/+2
|
* [3.8] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96503)Gregory P. Smith2022-09-053-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Correctly pre-check for int-to-str conversion Converting a large enough `int` to a decimal string raises `ValueError` as expected. However, the raise comes _after_ the quadratic-time base-conversion algorithm has run to completion. For effective DOS prevention, we need some kind of check before entering the quadratic-time loop. Oops! =) The quick fix: essentially we catch _most_ values that exceed the threshold up front. Those that slip through will still be on the small side (read: sufficiently fast), and will get caught by the existing check so that the limit remains exact. The justification for the current check. The C code check is: ```c max_str_digits / (3 * PyLong_SHIFT) <= (size_a - 11) / 10 ``` In GitHub markdown math-speak, writing $M$ for `max_str_digits`, $L$ for `PyLong_SHIFT` and $s$ for `size_a`, that check is: $$\left\lfloor\frac{M}{3L}\right\rfloor \le \left\lfloor\frac{s - 11}{10}\right\rfloor$$ From this it follows that $$\frac{M}{3L} < \frac{s-1}{10}$$ hence that $$\frac{L(s-1)}{M} > \frac{10}{3} > \log_2(10).$$ So $$2^{L(s-1)} > 10^M.$$ But our input integer $a$ satisfies $|a| \ge 2^{L(s-1)}$, so $|a|$ is larger than $10^M$. This shows that we don't accidentally capture anything _below_ the intended limit in the check. <!-- gh-issue-number: gh-95778 --> * Issue: gh-95778 <!-- /gh-issue-number --> Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org> Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* [3.8] gh-93065: Fix HAMT to iterate correctly over 7-level deep trees ↵Łukasz Langa2022-05-241-1/+13
| | | | | | | | | | | | (GH-93066) (#93148) Also while there, clarify a few things about why we reduce the hash to 32 bits. Co-authored-by: Eli Libman <eli@hyro.ai> Co-authored-by: Yury Selivanov <yury@edgedb.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit c1f5c903a7e4ed27190488f4e33b00d3c3d952e5)
* Post 3.8.13, take twoŁukasz Langa2022-03-161-1/+1
|
* Python 3.8.13, take twov3.8.13Łukasz Langa2022-03-161-1/+1
| | | | This reverts commit e5f711f5eeb6db4290db1b747f42f5d723d12ed3.
* Post 3.8.13Łukasz Langa2022-03-151-1/+1
|
* Python 3.8.13Łukasz Langa2022-03-151-2/+2
|
* Post 3.8.12Łukasz Langa2021-08-301-1/+1
|
* Python 3.8.12v3.8.12Łukasz Langa2021-08-301-2/+2
|
* Post 3.8.11Łukasz Langa2021-06-281-1/+1
|
* Python 3.8.11v3.8.11Łukasz Langa2021-06-281-2/+2
|
* Post 3.8.10Łukasz Langa2021-05-031-1/+1
|
* Python 3.8.10v3.8.10Łukasz Langa2021-05-031-2/+2
|
* bpo-43962: Fix _PyInterpreterState_IDIncref() (GH-25683) (GH-25686)Victor Stinner2021-04-281-1/+1
| | | | | | _PyInterpreterState_IDIncref() now calls _PyInterpreterState_IDInitref() and always increments id_refcount. (cherry picked from commit 32c5a174445ec93747240cd8472012276ed27acf)
* bpo-43816: Add extern "C" to Include/cpython/pyctype.h (GH-25365)Miss Islington (bot)2021-04-131-0/+6
| | | | | | Signed-off-by: Andrew V. Jones <andrew.jones@vector.com> (cherry picked from commit 54db51c9114ac49030832f5134979ca866ffd21c) Co-authored-by: Andrew V. Jones <andrewvaughanj@gmail.com>
* Post 3.8.9Łukasz Langa2021-04-021-1/+1
|
* Python 3.8.9v3.8.9Łukasz Langa2021-04-021-2/+2
|
* Post 3.8.8Łukasz Langa2021-02-191-1/+1
|
* Python 3.8.8v3.8.8Łukasz Langa2021-02-191-3/+3
|
* Post 3.8.8rc1Łukasz Langa2021-02-161-1/+1
|
* Python 3.8.8rc1v3.8.8rc1Łukasz Langa2021-02-161-4/+4
|
* bpo-43030: Fixed a compiler warning in Py_UNICODE_ISSPACE with signed ↵Miss Islington (bot)2021-01-311-1/+1
| | | | | | | | wchar_t (GH-24350) (GH-24397) (cherry picked from commit 42b1806af90b86ec393ca7da14e99ce95ec6c53b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.8] bpo-40052: Fix alignment issue in PyVectorcall_Function() (GH-23999) ↵Petr Viktorin2021-01-121-3/+3
| | | | | | | | | | (GH-24120) Co-Authored-By: Andreas Schneider <asn@cryptomilk.org> Co-Authored-By: Antoine Pitrou <antoine@python.org>. Co-authored-by: Petr Viktorin <encukou@gmail.com> (cherry picked from commit 056c08211b402b4dbc1530a9de9d00ad5309909f) https://bugs.python.org/issue40052
* Post 3.8.7Łukasz Langa2020-12-211-1/+1
|
* Python 3.8.7v3.8.7Łukasz Langa2020-12-211-3/+3
|
* Post 3.8.7rc1Łukasz Langa2020-12-081-1/+1
|
* Python 3.8.7rc1v3.8.7rc1Łukasz Langa2020-12-071-4/+4
|
* bpo-41686: Always create the SIGINT event on Windows (GH-23344) (GH-23347) ↵Victor Stinner2020-11-171-0/+2
| | | | | | | | | | (GH-23349) bpo-41686, bpo-41713: On Windows, the SIGINT event, _PyOS_SigintEvent(), is now created even if Python is configured to not install signal handlers (PyConfig.install_signal_handlers=0 or Py_InitializeEx(0)). (cherry picked from commit 05a5d697f4f097f37c5c1e2ed0e2338a33c3fb6a)
* bpo-41986: Add Py_FileSystemDefaultEncodeErrors and Py_UTF8Mode back to ↵Miss Skeleton (bot)2020-10-102-8/+7
| | | | | | | limited API (GH-22621) (cherry picked from commit 637a09b0d6e3ad4e34e0b5e0fc82f5afeae6f74b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Post 3.8.6Łukasz Langa2020-09-241-1/+1
|
* Python 3.8.6v3.8.6Łukasz Langa2020-09-231-3/+3
|
* Post 3.8.6rc1Łukasz Langa2020-09-081-1/+1
|
* Python 3.8.6rc1v3.8.6rc1Łukasz Langa2020-09-071-4/+4
|
* bpo-41098: Doc: Add missing deprecated directives (GH-21162)Miss Islington (bot)2020-08-071-2/+8
| | | | | | | PyUnicodeEncodeError_Create has been deprecated with `Py_DEPRECATED` macro. But it was not documented. (cherry picked from commit 46e19b61d31ba99f049258efa4ff1334856a3643) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* Post 3.8.5Łukasz Langa2020-07-201-1/+1
|
* Python 3.8.5v3.8.5Łukasz Langa2020-07-201-2/+2
| | | | Contains security fixes for CVE-2019-20907, CVE-2020-15801, and BPO-39603.
* Post 3.8.4Łukasz Langa2020-07-131-1/+1
|
* Python 3.8.4v3.8.4Łukasz Langa2020-07-131-3/+3
|
* Post 3.8.4rc1Łukasz Langa2020-06-301-1/+1
|
* Python 3.8.4rc1v3.8.4rc1Łukasz Langa2020-06-291-4/+4
|
* [3.9] bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20613) (GH-20616)Victor Stinner2020-06-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579) Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception. Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup these functions. (cherry picked from commit c353764fd564e401cf47a5d9efab18c72c60014e) * bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599) my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for pending signals, rather calling PyOS_InterruptOccurred(). my_fgets() is called with the GIL released, whereas PyOS_InterruptOccurred() must be called with the GIL held. test_repl: use text=True and avoid SuppressCrashReport in test_multiline_string_parsing(). Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed. (cherry picked from commit fa7ab6aa0f9a4f695e5525db5a113cd21fa93787)
* Post 3.8.3Łukasz Langa2020-05-131-1/+1
|
* Python 3.8.3v3.8.3Łukasz Langa2020-05-131-3/+3
|
* [3.8] bpo-39562: Prevent collision of future and compiler flags (GH-19230) ↵Pablo Galindo2020-05-012-13/+19
| | | | | | | | | | | (GH-19835) The constant values of future flags in the __future__ module is updated in order to prevent collision with compiler flags. Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing with CO_FUTURE_DIVISION.. (cherry picked from commit 4454057269b995341b04d13f0bf97f96080f27d0) Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
* Post 3.8.3rc1Łukasz Langa2020-04-291-1/+1
|
* Python 3.8.3rc1v3.8.3rc1Łukasz Langa2020-04-291-4/+4
|
* Remove extraneous ')' in abstract.h (GH-19146) (#19451)Miss Islington (bot)2020-04-091-1/+1
| | | | | | (cherry picked from commit ac2cfe6631b77a2005d8f16f034dbb6154f04ab2) Co-authored-by: Jimmy Yang <codingExpert123@gmail.com>
* bpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120) (GH-19136)Victor Stinner2020-03-241-0/+1
| | | | | | | | | | PyThreadState.frame is a borrowed reference, not a strong reference: PyThreadState_Clear() must not call Py_CLEAR(tstate->frame). Remove test_threading.test_warnings_at_exit(): we cannot warranty that the Python thread state of daemon threads is cleared in a reliable way during Python shutdown. (cherry picked from commit 5804f878e779712e803be927ca8a6df389d82cdf)
* Post 3.8.2Łukasz Langa2020-02-251-1/+1
|
* Python 3.8.2v3.8.2Łukasz Langa2020-02-241-3/+3
|