Skip to content

Commit dc8e1d0

Browse files
authored
gh-94101 Disallow instantiation of SSLSession objects (GH-94102)
Fixes #94101 Automerge-Triggered-By: GH:tiran
1 parent fda4b2f commit dc8e1d0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manual instantiation of :class:`ssl.SSLSession` objects is no longer allowed
2+
as it lead to misconfigured instances that crashed the interpreter when
3+
attributes where accessed on them.

Modules/_ssl.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -5067,7 +5067,8 @@ static PyType_Spec PySSLSession_spec = {
50675067
.name = "_ssl.SSLSession",
50685068
.basicsize = sizeof(PySSLSession),
50695069
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
5070-
Py_TPFLAGS_IMMUTABLETYPE),
5070+
Py_TPFLAGS_IMMUTABLETYPE |
5071+
Py_TPFLAGS_DISALLOW_INSTANTIATION),
50715072
.slots = PySSLSession_slots,
50725073
};
50735074

0 commit comments

Comments
 (0)