]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-94101 Disallow instantiation of SSLSession objects (GH-94102)
authorchgnrdv <52372310+chgnrdv@users.noreply.github.com>
Wed, 22 Jun 2022 10:10:22 +0000 (13:10 +0300)
committerGitHub <noreply@github.com>
Wed, 22 Jun 2022 10:10:22 +0000 (03:10 -0700)
Fixes #94101

Automerge-Triggered-By: GH:tiran
Misc/NEWS.d/next/Library/2022-06-22-11-16-11.gh-issue-94101.V9vDG8.rst [new file with mode: 0644]
Modules/_ssl.c

diff --git a/Misc/NEWS.d/next/Library/2022-06-22-11-16-11.gh-issue-94101.V9vDG8.rst b/Misc/NEWS.d/next/Library/2022-06-22-11-16-11.gh-issue-94101.V9vDG8.rst
new file mode 100644 (file)
index 0000000..bcef0ca
--- /dev/null
@@ -0,0 +1,3 @@
+Manual instantiation of :class:`ssl.SSLSession` objects is no longer allowed
+as it lead to misconfigured instances that crashed the interpreter when
+attributes where accessed on them.
index e67ab42050b26c08b1658f95651f521540e667fd..08596577086ac476f82301077d7b71ec94d7626a 100644 (file)
@@ -5067,7 +5067,8 @@ static PyType_Spec PySSLSession_spec = {
     .name = "_ssl.SSLSession",
     .basicsize = sizeof(PySSLSession),
     .flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
-              Py_TPFLAGS_IMMUTABLETYPE),
+              Py_TPFLAGS_IMMUTABLETYPE |
+              Py_TPFLAGS_DISALLOW_INSTANTIATION),
     .slots = PySSLSession_slots,
 };