| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
(GH-10217)
_io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range
value to the bitwise struct field.
(cherry picked from commit b08746bfdf64e55ce33516f2065fa2aa4f51be95)
Co-authored-by: Xiang Zhang <angwerzx@126.com>
|
|
|
|
|
| |
(cherry picked from commit 53835e92d315340444e3dd083b3f69a590b00e07)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
* Fix potential division by zero in BZ2_Malloc()
* Avoid division by zero in PyLzma_Malloc()
* Avoid division by zero and integer overflow in PyZlib_Malloc()
Reported by Svace static analyzer.
(cherry picked from commit 3d4fabb2a424cb04ae446ebe4428090c386f45a5)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
|
|
| |
(GH-9873). (GH-10183)
(cherry picked from commit f192aeb95a139ede74d69e39c046c498ff288a37)
Co-authored-by: Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) <srinivasreddy@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Declare functions with EXTINLINE:
* mpd_del()
* mpd_uint_zero()
* mpd_qresize()
* mpd_qresize_zero()
* mpd_minalloc()
These functions are implemented with "inline" or "ALWAYS_INLINE", but
declared without inline which cause linker error on Visual Studio in
Debug mode when using /Ob1.
(cherry picked from commit 3b1cba3701fd1321a9bdafa9e683f891369f0cfd)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
|
|
|
| |
Based on the investigation by Xiang Zhang.
(cherry picked from commit df13df41a25765d8a39a77220691698498e758d4)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
References could leak, NULL could be dereferenced, and the Expat parser could
be double freed when some errors raised.
(cherry picked from commit 9f3ed3e213b30059087d059a7d1d3b2527fa8654)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
|
| |
timemodule.c. (GH-9961)
Guard the `CLOCK_GETTIME` et al macros in `timemodule` based on the availability of the parent functions
(cherry picked from commit 94451182ccd6729c11338926d8a3d11645e86626)
Co-authored-by: Max Bélanger <aeromax@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
truncate() (GH-5784)
path_error() uses GetLastError() on Windows, but some os functions
are implemented via CRT APIs which report errors via errno.
This may result in raising OSError with invalid error code (such
as zero).
Introduce posix_path_error() function and use it where appropriate.
(cherry picked from commit 834603112e6ca35944dd21105b01fca562dc3241)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
|
|
|
|
| |
On failure, _PyBytes_Resize() will deallocate the bytes object and set
"result" to NULL.
https://bugs.python.org/issue34824
(cherry picked from commit 365ad2ead5bbaf7a3b18648ffa36e819559d3f75)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit d6a61f232619f8a8e6efacc3da5a02abaf25f090)
Co-authored-by: Chris Barker <Chris.Barker@noaa.gov>
|
|
|
|
|
| |
(cherry picked from commit 68def052dcd41313eff2bd9f269e22c5a941db4d)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
|
| |
C implementation of xml.etree.ElementTree.Element.__setstate__()
leaked references to children when called for already initialized
element.
(cherry picked from commit 6f906b3d727d6b341abd5ad9c0652bbcbd5eb024)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Restores the use of pyexpatns.h to isolate our embedded copy of the expat C
library so that its symbols do not conflict at link or dynamic loading time
with an embedding application or other extension modules with their own
version of libexpat.
https://github.com/python/cpython/commit/5dc3f23b5fb0b510926012cb3732dae63cddea60GH-diff-3afaf7274c90ce1b7405f75ad825f545 inadvertently removed it when upgrading expat.
(cherry picked from commit 9d4712bc8f26bf1d7e626b53ab092fe030bcd68d)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
https://bugs.python.org/issue35011
|
|
|
|
|
| |
On macOS, fix reading from and writing into a file with a size larger than 2 GiB.
(cherry picked from commit 74a8b6ea7e0a8508b13a1c75ec9b91febd8b5557)
|
|
|
|
|
|
| |
Methods find(), findtext() and findall() of xml.etree.ElementTree.Element
were not able to find chldren which are instances of Element subclasses.
(cherry picked from commit b11c5667f99c4f0018e3394c4d07c519d835671a)
|
|
|
|
|
|
|
|
|
| |
methods (GH-9751) (GH-9798) (GH-9801)
for the SHAKE algorithm in the hashlib module.
(cherry picked from commit 9b8c2e767643256202bb11456ba8665593b9a500)
(cherry picked from commit 8b040e55395b37bdb8fd4ec85a270cfc9ec95307)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-8581) (GH-9657)
* help(hashlib) didn't work because of incorrect module name in blake2b and
blake2s classes.
* Constructors blake2*(), sha3_*(), shake_*() and keccak_*() incorrectly
accepted keyword argument "string" for binary data, but documented as
accepting the "data" keyword argument. Now this parameter is positional-only.
* Keyword-only parameters in blake2b() and blake2s() were not documented as
keyword-only.
* Default value for some parameters of blake2b() and blake2s() was None,
which is not acceptable value.
* The length argument for shake_*.digest() was wrapped out to 32 bits.
* The argument for shake_128.digest() and shake_128.hexdigest() was not
positional-only as intended.
* TypeError messages for incorrect arguments in all constructors sha3_*(),
shake_*() and keccak_*() incorrectly referred to sha3_224.
Also made the following enhancements:
* More accurately specified input and result types for strings, bytes and
bytes-like objects.
* Unified positional parameter names for update() and constructors.
* Improved formatting.
(cherry picked from commit f1d36d8efaecd5c84cb35e35119b283f37d83c40)
(cherry picked from commit 47957dab94a4efa2fee61c9a8193f78300950769)
|
|
|
| |
(cherry picked from commit 683281f536981da395575b5a07d6761118259fd2)
|
|
|
|
|
| |
(cherry picked from commit addf8afb43af58b9bf56a0ecfd0f316dd60ac0c3)
(cherry picked from commit d9212200fe8ddb55d73b8231869cfbb32635ba92)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-9679) (GH-9690)
The C implementation of asyncio.Task currently fails to perform the
cancellation cleanup correctly in the following scenario.
async def task1():
async def task2():
await task3 # task3 is never cancelled
asyncio.current_task().cancel()
await asyncio.create_task(task2())
The actuall error is a hardcoded call to `future_cancel()` instead of
calling the `cancel()` method of a future-like object.
Thanks to Vladimir Matveev for noticing the code discrepancy and to
Yury Selivanov for coming up with a pathological scenario.
(cherry picked from commit 548ce9dedd2e90945970671d441436a6a91608ab)
https://bugs.python.org/issue34872
|
|
|
|
|
|
| |
_pickle.Unpickler.__init__() should return -1 if Pdata_New() fails, not 1.
(cherry picked from commit 4b430e5f6954ef4b248e95bfb4087635dcdefc6d)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add SSLContext.post_handshake_auth and
SSLSocket.verify_client_post_handshake for TLS 1.3 post-handshake
authentication.
Signed-off-by: Christian Heimes <christian@python.org>q
https://bugs.python.org/issue34670.
(cherry picked from commit 9fb051f032c36b9f6086b79086b4d6b7755a3d70)
Co-authored-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue34670
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
OpenSSL follows the convention that whenever you call a function, it
returns an error indicator value; and if this value is negative, then
you need to go look at the actual error code to see what happened.
Commit c6fd1c1c3a introduced a small mistake in
_ssl__SSLSocket_shutdown_impl: instead of checking whether the error
indicator was negative, it started checking whether the actual error
code was negative, and it turns out that the error codes are never
negative. So the effect was that 'unwrap()' lost the ability to raise
SSL errors.
https://bugs.python.org/issue34759.
(cherry picked from commit c0da582b227f311126e278b5553a7fa89c79b054)
Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
https://bugs.python.org/issue34759
|
|
|
|
|
|
| |
There was a missing PyMem_Free(format) in time_strftime().
(cherry picked from commit 91e6c8717b7dcbcc46b189509de5f2d335819f37)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit a4ae828ee416a66d8c7bf5ee71d653c2cc6a26dd)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
|
|
|
|
| |
(cherry picked from commit 8d1e190fc507a9e304f6817e761e9f628a23cbd8)
Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The C accelerated _elementtree module now initializes hash randomization
salt from _Py_HashSecret instead of libexpat's default CPRNG.
Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue34623
(cherry picked from commit cb5778f00ce48631c7140f33ba242496aaf7102b)
Co-authored-by: Christian Heimes <christian@python.org>
|
| |
|
|
|
|
|
|
|
|
| |
Include ``openssl/dh.h`` header file to fix implicit function declaration of ``DH_free()``.
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
(cherry picked from commit b3a271fc0ce3e13e427be8914decfc205a220ca8)
Co-authored-by: Alexandru Ardelean <ardeleanalex@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 7843caeb909bd907e903606414e238db4082315a)
Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
|
|
|
|
|
|
| |
Reported by Svace static analyzer.
(cherry picked from commit 6f82bffd2df63a4072b3f0483cdbe93ddedb87e9)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
|
|
| |
(GH-4178)
(cherry picked from commit 4859ba0d2ce4506fddc3f55f90f8dce031b3804f)
Co-authored-by: Max Bélanger <aeromax@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 731ff68eeef58babdf2b32dc9a73b141760c2be9)
Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit b9bf9d025e659b5a1963027eb73690e57cb35dd0)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
|
|
|
|
|
|
| |
_collections.deque with a bad __new__(). (GH-9178)
(cherry picked from commit 24bd50bdcc97d65130c07d6cd26085fd06c3e972)
Co-authored-by: Oren Milman <orenmn@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When subprocess.Popen() stdin= stdout= or stderr= handles are specified
and appear in pass_fds=, don't close the original fds after dup'ing them.
This implementation and unittest primarily came from @izbyshev (see the PR)
See also https://github.com/izbyshev/cpython/commit/b89b52f28490b69142d5c061604b3a3989cec66c
This also removes the old manual p2cread, c2pwrite, and errwrite closing logic
as inheritable flags and _close_open_fds takes care of that properly today without special treatment.
This code is within child_exec() where it is the only thread so there is no
race condition between the dup and _Py_set_inheritable_async_safe call.
(cherry picked from commit ce34410b8b67f49d8275c05d51b3ead50cf97f48)
Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
|
|
|
|
|
| |
(cherry picked from commit 5033aa77aacaa5505636f150e8d54baac5bdca9c)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
|
|
|
|
|
|
| |
Many type object initializations labeled a field "tp_size" in the
comment, but the name of that field is tp_basicsize..
(cherry picked from commit 0e0bc4e221f592f305d335faf5f8046484eb9238)
Co-authored-by: Peter Eisentraut <peter@eisentraut.org>
|
|
|
|
|
|
|
|
|
| |
(GH-9098) (GH-9105)
Pass the user/group name as Unicode to the formatting function,
instead of always decoding a bytes string from UTF-8..
(cherry picked from commit 28658485a54ad5f9df52ecc12d9046269f1654ec)
Co-authored-by: William Grzybowski <wg@FreeBSD.org>
|
|
|
|
|
|
|
| |
multiprocessing.Process (GH-9027) (GH-9069)
Fix for invalid assert on big output of multiprocessing.Process.
(cherry picked from commit 266f4904a222a784080e29aad0916849e507515d)
|
|
|
|
|
|
| |
Avoids an integer underflow in the time module's year handling code.
(cherry picked from commit 76be0fffff8b7dbe649ad4821144461800ffb0d0)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
|
|
|
|
|
| |
Reported by Svace static analyzer.
(cherry picked from commit f8c06b028036e50596e75d4c9f6b27ba05133efe)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
|
|
| |
(GH-8756)
(cherry picked from commit 67b9cc8e6072a919d2ed7e7ecc8124c8acfb3733)
Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Backport of TLS 1.3 related fixes from 3.7.
Misc fixes and workarounds for compatibility with OpenSSL 1.1.1 from git
master and TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by
default. Some test cases only apply to TLS 1.2.
OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS
1.3. The feature is enabled by default for maximum compatibility with
broken middle boxes. Users should be able to disable the hack and CPython's test suite needs
it to verify default options
Signed-off-by: Christian Heimes <christian@python.org>
|
|
|
|
|
| |
(cherry picked from commit 2ebd3813af9172fe1f9b2f6004edf6f1e1e5d9f1)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-8584)
* Fix integer overflow in os.readv(), os.writev() and in os.sendfile()
with headers or trailers arguments (on BSD-based OSes and MacOS).
* Fix sending the part of the file in os.sendfile() on MacOS.
Using the trailers argument could cause sending more bytes from
the input file than was specified.
Thanks Ned Deily for testing on 32-bit MacOS.
(cherry picked from commit 9d5727326af53ddd91016d98e16ae7cf829caa95)
|
|
|
|
|
| |
(GH-7911)
Co-authored-by: ValeriyaSinevich <valeriya.sinevich@phystech.edu>
|
|
|
|
|
|
|
|
| |
(GH-2385) (GH-8498)
On Windows, passing a negative value to local results in an OSError because localtime_s on Windows does not support negative timestamps. Unfortunately this means that fold detection for timestamps between 0 and max_fold_seconds will result in this OSError since we subtract max_fold_seconds from the timestamp to detect a fold. However, since we know there haven't been any folds in the interval [0, max_fold_seconds) in any timezone, we can hackily just forego fold detection for this time range on Windows..
(cherry picked from commit 96d1e69a12ed8ab80203277e1abdaf573457a964)
Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
|
|
|
|
|
|
|
| |
exception set (GH-8282). (GH-8312)
(cherry picked from commit 28f07364f066792ceee93231dbb80ae8ad98b2bb)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|