summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [2.7] bpo-32947: Fixes for TLS 1.3 and OpenSSL 1.1.1 (GH-8761) (GH-11876)stratakis2019-02-151-0/+4
| | | | | | | | | | | | | | | 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 2a4ee8aa01d61b6a9c8e9c65c211e61bdb471826)
* [2.7] bpo-28043: improved default settings for SSLContext (GH-10608)stratakis2019-02-151-0/+31
| | | | | | | | | The options OP_NO_COMPRESSION, OP_CIPHER_SERVER_PREFERENCE, OP_SINGLE_DH_USE, OP_SINGLE_ECDH_USE, OP_NO_SSLv2 (except for PROTOCOL_SSLv2), and OP_NO_SSLv3 (except for PROTOCOL_SSLv3) are set by default. The initial cipher suite list contains only HIGH ciphers, no NULL ciphers and MD5 ciphers (except for PROTOCOL_SSLv2). (cherry picked from commit 358cfd426ccc0fcd6a7940d306602138e76420ae)
* bpo-35746: Fix segfault in ssl's cert parser (GH-11569)Miss Islington (bot)2019-01-151-0/+4
| | | | | | | | | | | | Fix a NULL pointer deref in ssl module. The cert parser did not handle CRL distribution points with empty DP or URI correctly. A malicious or buggy certificate can result into segfault. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue35746 (cherry picked from commit a37f52436f9aa4b9292878b72f3ff1480e2606c3) Co-authored-by: Christian Heimes <christian@python.org>
* [2.7] bpo-8765: Deprecate writing unicode to binary streams in Py3k mode. ↵Serhiy Storchaka2019-01-152-1/+16
| | | | (GH-11127)
* bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. ↵Zackery Spytz2018-12-204-0/+16
| | | | | (GH-11175) (GH-11249) (cherry picked from commit 842acaab1376c5c84fd5966bb6070e289880e1ca)
* bpo-35529: Fix a reference counting bug in PyCFuncPtr_FromDll(). (GH-11229)Miss Islington (bot)2018-12-201-5/+8
| | | | | | | "dll" would leak if an error occurred in _validate_paramflags() or GenericPyCData_new(). (cherry picked from commit d77d97c9a1f593fe161afab97e2a3e2292ab88b9) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [2.7] bpo-35441: Remove dead and buggy code related to PyList_SetItem(). ↵Serhiy Storchaka2018-12-194-19/+21
| | | | | | | | | | | | | | (GH-11033) (GH-11234) In _localemodule.c and selectmodule.c, remove dead code that would cause double decrefs if run. In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases where a new list is populated and there is no possibility of an error. In addition, check if the list changed size in the loop in array_array_fromlist(). (cherry picked from commit 99d56b53560b3867844472ae381fb3f858760621) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-10320: Use PY_FORMAT_LONG_LONG in ctypes' PyCArg_repr(). (GH-11230)Zackery Spytz2018-12-191-5/+1
|
* bpo-10320: Replace nonstandard sprintf() length modifier in ctypes' ↵Miss Islington (bot)2018-12-181-1/+1
| | | | | | | | PyCArg_repr(). (GH-10853) Use "ll" instead of the nonstandard "q". (cherry picked from commit 062cbb67726f26794b1b461853e40696b4a0b220) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [2.7] bpo-31374: Include pyconfig.h earlier in expat (GH-11078)Victor Stinner2018-12-102-1/+6
| | | | Include <pyconfig.h> ealier in Modules/expat/xmlparse.c to define properly _POSIX_C_SOURCE and _XOPEN_SOURCE.
* bpo-31374: Include pyconfig.h earlier in expat (GH-11064)Miss Islington (bot)2018-12-101-0/+1
| | | | | | | | | Include <pyconfig.h> ealier in Modules/expat/xmltok.c to define properly _POSIX_C_SOURCE. Python defines _POSIX_C_SOURCE as 200809L, whereas <features.h> (included indirectly by <string.h>) defines _POSIX_C_SOURCE as 199506L. (cherry picked from commit cf247359d5b7082044eea1fa94b5211a172b1ff6) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* [2.7] bpo-34052: Prevent SQLite functions from setting callbacks on ↵Serhiy Storchaka2018-12-051-20/+13
| | | | | | | | | exceptions. (GH-8113). (GH-10946) (GH-10955) (cherry picked from commit 5b25f1d03100e2283c1b129d461ba68ac0169a14) (cherry picked from commit 1de91a0032fed500ddd3d8c4fb7a38c0b8719f67) Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>.
* [2.7] bpo-16865: Support arrays >=2GB in ctypes. (GH-3006). (GH-7441)Serhiy Storchaka2018-12-041-6/+18
| | | | | | (cherry picked from commit 735abadd5bd91db4a9e6f4311969b0afacca0a1a) Co-Authored-By: Segev Finer <segev208@gmail.com>
* [2.7] bpo-25862: Fix several bugs in the _io module. (GH-8026) (GH-8033)Serhiy Storchaka2018-12-042-7/+17
| | | | | | | | | | | They can be exposed when some C API calls fail due to lack of memory. * Failed Py_BuildValue() could cause an assertion error in the following TextIOWrapper.tell(). * initvalue could leak in StringIO.__getstate__() after failed PyDict_Copy(). (cherry picked from commit fdb5a50ef34f7951c3b01eb77b1359725a9ad670)
* bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808)Miss Islington (bot)2018-11-301-0/+1
| | | | | (cherry picked from commit a2e3585e79c93b2372dbad46a744e28fcc6dad6d) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [2.7] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) ↵Serhiy Storchaka2018-11-201-46/+50
| | | | | | | | | | | | | (GH-10617) Fixes assertion failures in _datetimemodule.c introduced in the previous fix (see bpo-31752). Rather of trying to handle an int subclass as exact int, let it to use overridden special methods, but check the result of divmod(). (cherry picked from commit 3ec0f495163da3b7a15deb2805cec48aed432f58) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Fix a possible reference leak in _socket.getaddrinfo(). (GH-10543)Miss Islington (bot)2018-11-151-2/+4
| | | | | | "single" needs to be decrefed if PyList_Append() fails. (cherry picked from commit 4c596d54aa6a55e9d2a3db78891e656ebbfb63c8) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [2.7] bpo-35194: Fix a wrong constant in cp932 codec. (GH-10420) (GH-10433)Alexey Izbyshev2018-11-101-1/+1
| | | | | | | | This typo doesn't affect the result because wrong bits are discarded on implicit conversion to unsigned char, but it trips UBSan with -fsanitize=implicit-integer-truncation. (cherry picked from commit 7a69cf47a9bbc95f95fd67c982bff121b2a903cb) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
* [2.7] closes bpo-35139: The `pyexpat` module's macros in `Modules/Setup` now ↵Benjamin Peterson2018-11-021-1/+1
| | | | | | | | match `setup.py` (GH-10293) This could cause compile errors on macOS or other platforms.. (cherry picked from commit 318ab63c01f5b8e7562b122ab5ba01258a51277b) Co-authored-by: Max Bélanger <aeromax@gmail.com>
* bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. ↵Miss Islington (bot)2018-10-311-1/+1
| | | | | | | | | (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>
* [2.7] Fix a possible "double decref" in termios.tcgetattr(). (GH-10194) ↵Zackery Spytz2018-10-291-2/+2
| | | | | (GH-10218) (cherry picked from commit 53835e92d315340444e3dd083b3f69a590b00e07)
* [2.7] bpo-35068: Fix possible crashes in pyexpat.c. (GH-10099)Zackery Spytz2018-10-291-17/+11
|
* [2.7] bpo-34794: Fix a leak in Tkinter. (GH-10025) (GH-10181)Serhiy Storchaka2018-10-281-4/+2
| | | | | Based on the investigation by Xiang Zhang. (cherry picked from commit df13df41a25765d8a39a77220691698498e758d4)
* [2.7] Fix error handling bugs in _elementtree.c. (GH-10060) (GH-10080)Zackery Spytz2018-10-261-28/+37
| | | | | | | Don't leak a reference if PyDict_Update() fails, check the PyList_New() call in treebuilder_new(), and properly handle failures in xmlparser(). (cherry picked from commit 9f3ed3e213b30059087d059a7d1d3b2527fa8654)
* Fix several reference counting bugs in pyexpat.c. (GH-9955)Miss Islington (bot)2018-10-191-4/+8
| | | | | (cherry picked from commit 68def052dcd41313eff2bd9f269e22c5a941db4d) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [2.7] bpo-34603, ctypes/libffi_msvc: Fix returning structs from functions ↵Vladimir Matveev2018-09-195-6/+221
| | | | | (GH-9258) (GH-9425) Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
* [2.7] bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146) (GH-9394)Christian Heimes2018-09-182-0/+10
| | | | | | | | | | | | | | | 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> https://bugs.python.org/issue34623
* [2.7] bpo-34710: fix SSL module build (GH-9347) (GH-9353)Christian Heimes2018-09-171-0/+1
| | | | | | | | | | | | 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> https://bugs.python.org/issue34710
* bpo-34649: Add missing NULL checks to _encoded_const() (GH-9225)Miss Islington (bot)2018-09-121-3/+3
| | | | | | Reported by Svace static analyzer. (cherry picked from commit 6f82bffd2df63a4072b3f0483cdbe93ddedb87e9) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
* [2.7] bpo-28994: Remove mistakenly backported atexitmodule.c (GH-9214)Zackery Spytz2018-09-121-346/+0
| | | | It was backported in 0cc43df05e36655220468953e838169966b94ebd.
* [2.7] Delete old expat comment. (GH-9205)Benjamin Peterson2018-09-121-8/+0
| | | | | (cherry picked from commit b9bf9d025e659b5a1963027eb73690e57cb35dd0) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [2.7] closes bpo-31608: Fix a crash in methods of a subclass of ↵Benjamin Peterson2018-09-111-2/+11
| | | | _collections.deque with a bad __new__(). (GH-9179)
* bpo-34625: Update vendorized expat version to 2.2.6. (GH-9150)Miss Islington (bot)2018-09-114-27/+69
| | | | | (cherry picked from commit 5033aa77aacaa5505636f150e8d54baac5bdca9c) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [2.7] Fix misleading mentions of tp_size in comments (GH-9138)Benjamin Peterson2018-09-105-8/+8
| | | | | | | 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>
* bpo-34491: Add missing Py_DECREF() in _bsddb's DB_join() (GH-8909)Zackery Spytz2018-08-251-0/+1
|
* bpo-34395: Fix memory leaks caused by incautious usage of PyMem_Realloc(). ↵Sergey Fedoseev2018-08-171-32/+24
| | | | (GH-8785)
* Fix docstring of Profiler class (GH-8651)Miss Islington (bot)2018-08-031-2/+2
| | | | | (cherry picked from commit 2ebd3813af9172fe1f9b2f6004edf6f1e1e5d9f1) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
* Fix compilation warnings on Windows (GH-8627)Victor Stinner2018-08-022-2/+2
| | | | | | | | | | | | | | | | | | | * Fix compilation warning in _ctypes module on Window (cherry picked from commit 20f11fe43c47b68c8b9dd6539d2d40b66c9957f9) * Fix compilation warnings on Windows 64-bit (cherry picked from commit 725e4212229bf68f87d4f66c1815d444ddfc7aa5) * Fix compiler warning in unicodeobject.c Explicitly case to Py_UNICODE to fix the warning: Objects\unicodeobject.c(4225): warning C4244: '=' : conversion from 'long' to 'Py_UNICODE', possible loss of data The downcast cannot overflow since we check that value <= 0x10ffff.
* bpo-29565: Fix compilation for C89 (GH-8626)Victor Stinner2018-08-021-8/+12
| | | Use a local scope for the 'i' variable.
* bpo-29565: Corrected ctypes passing of large structs by value on Windows ↵Victor Stinner2018-08-022-0/+23
| | | | | | | | | | | | | | AMD64 (GH-168) (GH-8625) Fixed bpo-29565: Corrected ctypes passing of large structs by value. Added code and test to check that when a structure passed by value is large enough to need to be passed by reference, a copy of the original structure is passed. The callee updates the passed-in value, and the test verifies that the caller's copy is unchanged. A similar change was also added to the test added for bpo-20160 (that test was passing, but the changes should guard against regressions). (cherry picked from commit a86339b83fbd0932e0529a3c91935e997a234582)
* [2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)Serhiy Storchaka2018-07-3119-48/+45
|
* bpo-34229: Check start and stop of slice object to be long when they are not ↵Xtreak2018-07-261-0/+24
| | | | int in PySlice_GetIndices (GH-8480)
* bpo-25943: Check for integer overflow in bsddb's DB_join(). (GH-8392)Zackery Spytz2018-07-221-1/+7
|
* bpo-25943: Fix potential heap corruption in bsddb's _db_associateCallback() ↵Zackery Spytz2018-07-211-39/+54
| | | | | | | (GH-8337) There was a missing check for integer overflow, several function calls were not checked for failure, and allocated memory was not freed if an error occurred.
* [2.7] bpo-34068: iobase_close could call PyObject_SetAttrString with an ↵Serhiy Storchaka2018-07-171-3/+11
| | | | | | | | | exception set (GH-8282). (GH-8312) (GH-8314) (cherry picked from commit 28f07364f066792ceee93231dbb80ae8ad98b2bb) Co-authored-by: Zackery Spytz <zspytz@gmail.com>. (cherry picked from commit cc13016658a9ed86d0b702ab6c251ad5952a952f)
* [2.7] bpo-23927: Make getargs.c skipitem() skipping 'w*'. (GH-8192). (GH-8255)Serhiy Storchaka2018-07-111-0/+61
| | | | | (cherry picked from commit 504373c59b48f1ea12132d515459022730db6047) Also backport tests for skipitem() and handling errors.
* [2.7] prefix internal sqlite symbols with _pysqlite_ (GH-8215). (GH-8217)Benjamin Peterson2018-07-104-18/+18
| | | | | (cherry picked from commit 7762e4d3872818272800dfbd8e1d8e3a689eb8f2) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [2.7] delete some unused pysqlite forward declarations (GH-8211). (GH-8214)Benjamin Peterson2018-07-101-4/+0
| | | | | (cherry picked from commit d6d4432724b12efc0d280b8eb80bca0deb8d4323) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* Don't export pending_threadfunc from _testcapi. (GH-8075)Miss Islington (bot)2018-07-041-1/+2
| | | | | (cherry picked from commit b4588c2fffbda91e4c2f0cf2b0fc3d14def95608) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [2.7] bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). ↵Zackery Spytz2018-06-291-0/+4
| | | | | | | (GH-3918). (GH-8013) (cherry picked from commit 23db935bcf258657682e66464bf8512def8af830) Co-authored-by: Zackery Spytz <zspytz@gmail.com>