summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Post 3.9.14Łukasz Langa2022-09-061-1/+1
|
* Python 3.9.14v3.9.14Łukasz Langa2022-09-061-2/+2
|
* [3.9] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96502)Gregory P. Smith2022-09-053-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Correctly pre-check for int-to-str conversion (#96537) 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>
* gh-93065: Fix HAMT to iterate correctly over 7-level deep trees (GH-93066) ↵Miss Islington (bot)2022-05-241-1/+13
| | | | | | | | | | | | (#93147) 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.9.13Łukasz Langa2022-05-171-1/+1
|
* Python 3.9.13v3.9.13Łukasz Langa2022-05-171-2/+2
|
* Post 3.9.12Łukasz Langa2022-03-241-1/+1
|
* Python 3.9.12v3.9.12Łukasz Langa2022-03-231-2/+2
|
* Post 3.9.11, take twoŁukasz Langa2022-03-161-1/+1
|
* Python 3.9.11, take twov3.9.11Łukasz Langa2022-03-161-1/+1
|
* Post 3.9.11Łukasz Langa2022-03-151-1/+1
|
* Python 3.9.11Łukasz Langa2022-03-151-2/+2
|
* Post 3.9.10Łukasz Langa2022-01-141-1/+1
|
* Python 3.9.10v3.9.10Łukasz Langa2022-01-131-2/+2
|
* bpo-39026: Fix Python.h when building with Xcode (GH-29488) (GH-29776)Victor Stinner2021-11-262-4/+1
| | | | | | Fix Python.h to build C extensions with Xcode: remove a relative include from Include/cpython/pystate.h. (cherry picked from commit 4ae26b9c1d0c33e3db92c6f305293f9240dea358)
* [3.9] bpo-45806: Fix recovery from stack overflow for 3.9. Again. (GH-29640)Mark Shannon2021-11-191-16/+0
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* Post 3.9.9Łukasz Langa2021-11-151-1/+1
|
* Python 3.9.9v3.9.9Łukasz Langa2021-11-151-2/+2
|
* Post 3.9.8Łukasz Langa2021-11-051-1/+1
|
* Python 3.9.8v3.9.8Łukasz Langa2021-11-051-2/+2
|
* bpo-45467: Fix IncrementalDecoder and StreamReader in the ↵Serhiy Storchaka2021-10-141-0/+8
| | | | | | | | | | "raw-unicode-escape" codec (GH-28944) (GH-28953) They support now splitting escape sequences between input chunks. Add the third parameter "final" in codecs.raw_unicode_escape_decode(). It is True by default to match the former behavior. (cherry picked from commit 39aa98346d5dd8ac591a7cafb467af21c53f1e5d)
* [3.9] bpo-45461: Fix IncrementalDecoder and StreamReader in the ↵Serhiy Storchaka2021-10-141-1/+9
| | | | | | | | | | | | "unicode-escape" codec (GH-28939) (GH-28945) They support now splitting escape sequences between input chunks. Add the third parameter "final" in codecs.unicode_escape_decode(). It is True by default to match the former behavior. (cherry picked from commit c96d1546b11b4c282a7e21737cb1f5d16349656d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.9] Fix typos in the Include directory (GH-28745) (GH-28788)Christian Clauss2021-10-074-5/+5
| | | (cherry picked from commit 8e8f7522171ef82f2f5049940f815e00e38c6f42)
* [3.9] Remove trailing spaces (GH-28710)Serhiy Storchaka2021-10-031-1/+1
|
* closes bpo-44751: Move crypt.h include from public header to _cryptmodule ↵Miss Islington (bot)2021-09-291-13/+0
| | | | | | | | (GH-27394) Automerge-Triggered-By: GH:benjaminp (cherry picked from commit 196998e220d6ca030e5a1c8ad63fcaed8e049a98) Co-authored-by: Geoffrey Thomas <geofft@ldpreload.com>
* [3.9] [codemod] Fix non-matching bracket pairs (GH-28473) (GH-28512)Łukasz Langa2021-09-221-1/+1
| | | | | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>. (cherry picked from commit 8f943ca25732d548cf9f0b0393ba8d582fb93e29) Co-authored-by: Mohamad Mansour <66031317+mohamadmansourX@users.noreply.github.com>
* [3.9] bpo-45083: Include the exception class qualname when formatting an ↵Miss Islington (bot)2021-09-031-0/+3
| | | | | | | | | | | exception (GH-28119) (GH-28135) * bpo-45083: Include the exception class qualname when formatting an exception (GH-28119) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> (cherry picked from commit b4b6342848ec0459182a992151099252434cc619) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* Post 3.9.7Łukasz Langa2021-08-301-1/+1
|
* Python 3.9.7v3.9.7Łukasz Langa2021-08-301-2/+2
|
* bpo-44184: Fix subtype_dealloc() for freed type (GH-26274)Miss Islington (bot)2021-07-151-1/+1
| | | | | | | | | | | | Fix a crash at Python exit when a deallocator function removes the last strong reference to a heap type. Don't read type memory after calling basedealloc() since basedealloc() can deallocate the type and free its memory. _PyMem_IsPtrFreed() argument is now constant. (cherry picked from commit 615069eb08494d089bf24e43547fbc482ed699b8) Co-authored-by: Victor Stinner <vstinner@python.org>
* Post 3.9.6Łukasz Langa2021-06-281-1/+1
|
* Python 3.9.6v3.9.6Łukasz Langa2021-06-281-2/+2
|
* bpo-44363: Get test_capi passing with address sanitizer (GH-26639)Miss Islington (bot)2021-06-101-1/+10
| | | | | (cherry picked from commit 31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b) Co-authored-by: Mark Shannon <mark@hotpy.org>
* [3.9] bpo-43667: Fix broken Unicode encoding in non-UTF locales on Solaris ↵Jakub Kulík2021-05-211-0/+12
| | | | | | | (GH-25096) (GH-25847) (cherry picked from commit 9032cf5cb1e33c0349089cfb0f6bf11ed3c30e86) Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
* Post 3.9.5Łukasz Langa2021-05-031-1/+1
|
* Python 3.9.5v3.9.5Łukasz Langa2021-05-031-2/+2
|
* bpo-43816: Add extern "C" to Include/cpython/pyctype.h (GH-25365) (GH-25387)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> Co-authored-by: Andrew V. Jones <andrewvaughanj@gmail.com>
* Post 3.9.4Łukasz Langa2021-04-041-1/+1
|
* Python 3.9.4v3.9.4Łukasz Langa2021-04-041-2/+2
|
* [3.9] bpo-43710: Rollback the 3.9 bpo-42500 fix, it broke the ABI in 3.9.3 ↵Gregory P. Smith2021-04-042-1/+18
| | | | | | | (#25179) This reverts commit 8b795ab5541d8a4e69be4137dfdc207714270b77. It changed the PyThreadState structure size, breaking the ABI in 3.9.3.
* Post 3.9.3Łukasz Langa2021-04-021-1/+1
|
* Python 3.9.3v3.9.3Łukasz Langa2021-04-021-2/+2
|
* bpo-42500: Fix recursion in or after except (GH-23568) (#24501)Mark Shannon2021-03-022-18/+1
| | | | | * Use counter, rather boolean state when handling soft overflows. (cherry picked from commit 4e7a69bdb63a104587759d7784124492dcdd496e)
* Post 3.9.2Łukasz Langa2021-02-191-1/+1
|
* Python 3.9.2v3.9.2Łukasz Langa2021-02-191-3/+3
|
* Post 3.9.2rc1Łukasz Langa2021-02-161-1/+1
|
* Python 3.9.2rc1v3.9.2rc1Łukasz Langa2021-02-161-4/+4
|
* bpo-35295: Remove outdated comment. (GH-24453)Miss Islington (bot)2021-02-051-7/+0
| | | | | (cherry picked from commit d938816acf71a74f1bd13fdf0534b3d9ea962e44) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* bpo-43030: Fixed a compiler warning in Py_UNICODE_ISSPACE with signed ↵Miss Islington (bot)2021-01-311-1/+1
| | | | | | | wchar_t (GH-24350) (cherry picked from commit 42b1806af90b86ec393ca7da14e99ce95ec6c53b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.9] bpo-40052: Fix alignment issue in PyVectorcall_Function() (GH-23999) ↵Miss Islington (bot)2021-01-051-3/+3
| | | | | | | | | | | | | | | | | | | | (GH-24005) ``` In file included from /usr/include/python3.8/Python.h:147: In file included from /usr/include/python3.8/abstract.h:837: /usr/include/python3.8/cpython/abstract.h:91:11: error: cast from 'char *' to 'vectorcallfunc *' (aka 'struct _object *(**)(struct _object *, struct _object *const *, unsigned long, struct _object *)') increases required alignment from 1 to 8 [-Werror,-Wcast-align] ptr = (vectorcallfunc*)(((char *)callable) + offset); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-Authored-By: Andreas Schneider <asn@cryptomilk.org> Co-Authored-By: Antoine Pitrou <antoine@python.org> (cherry picked from commit 056c08211b402b4dbc1530a9de9d00ad5309909f)