Skip to content

Commit

Permalink
gh-94101 Disallow instantiation of SSLSession objects (GH-94102)
Browse files Browse the repository at this point in the history
Fixes GH-94101

Automerge-Triggered-By: GH:tiran
(cherry picked from commit dc8e1d0)

Co-authored-by: chgnrdv <[email protected]>
  • Loading branch information
miss-islington and chgnrdv authored Jun 22, 2022
1 parent e51a22b commit 2e8eac1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 2 additions & 1 deletion Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down

0 comments on commit 2e8eac1

Please sign in to comment.