mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
[3.13] gh-126106: Fix NULL
possible derefrence in Modules/_ssl.c
(GH-126111) (#126116)
gh-126106: Fix `NULL` possible derefrence in `Modules/_ssl.c` (GH-126111)
(cherry picked from commit a64a1c9206
)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
parent
e7c63107d1
commit
e2c188455f
2 changed files with 4 additions and 3 deletions
|
@ -0,0 +1 @@
|
|||
Fixes a possible ``NULL`` pointer dereference in :mod:`ssl`.
|
|
@ -5206,14 +5206,14 @@ PySSLSession_dealloc(PySSLSession *self)
|
|||
static PyObject *
|
||||
PySSLSession_richcompare(PyObject *left, PyObject *right, int op)
|
||||
{
|
||||
int result;
|
||||
PyTypeObject *sesstype = ((PySSLSession*)left)->ctx->state->PySSLSession_Type;
|
||||
|
||||
if (left == NULL || right == NULL) {
|
||||
PyErr_BadInternalCall();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int result;
|
||||
PyTypeObject *sesstype = ((PySSLSession*)left)->ctx->state->PySSLSession_Type;
|
||||
|
||||
if (!Py_IS_TYPE(left, sesstype) || !Py_IS_TYPE(right, sesstype)) {
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue