Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Disallow instantiation of SSLSession objects
Directly instantiated SSLSession objects don't make much sense, but attribute lookup on them causes segmentation fault. This commit makes SSLSession objects non-instantiable.
  • Loading branch information
chgnrdv committed Jun 21, 2022
commit 51796521f54162543435b673a1b6b65deaf170f3
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