Skip to content

Commit 8abfb36

Browse files
vstinnerpicnixz
authored andcommitted
pythongh-126455: Disallow _ssl.SSLSocket instantiation (python#126481)
Prevent creation of incomplete/invalid _ssl.SSLSocket objects when created directly.
1 parent a605240 commit 8abfb36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_ssl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2979,7 +2979,7 @@ static PyType_Spec PySSLSocket_spec = {
29792979
.name = "_ssl._SSLSocket",
29802980
.basicsize = sizeof(PySSLSocket),
29812981
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_IMMUTABLETYPE |
2982-
Py_TPFLAGS_HAVE_GC),
2982+
Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_DISALLOW_INSTANTIATION),
29832983
.slots = PySSLSocket_slots,
29842984
};
29852985

0 commit comments

Comments
 (0)