Skip to content

Commit

Permalink
pythongh-126455: Disallow _ssl.SSLSocket instantiation (pythonGH-126481)
Browse files Browse the repository at this point in the history
Prevent creation of incomplete/invalid _ssl.SSLSocket objects when
created directly.
(cherry picked from commit b1c4ffc)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
vstinner authored and miss-islington committed Nov 6, 2024
1 parent 4f15846 commit c5c4bd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2921,7 +2921,7 @@ static PyType_Spec PySSLSocket_spec = {
.name = "_ssl._SSLSocket",
.basicsize = sizeof(PySSLSocket),
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
Py_TPFLAGS_HAVE_GC),
Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_DISALLOW_INSTANTIATION),
.slots = PySSLSocket_slots,
};

Expand Down

0 comments on commit c5c4bd1

Please sign in to comment.