Skip to content

del ssl.SSLContext().keylog_filename crashes #156099

Description

@serhiy-storchaka

Crash report

import ssl
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
del ctx.keylog_filename

_PySSLContext_set_keylog_filename() in Modules/_ssl/debughelpers.c does not check the value for NULL and passes it to Py_fopen().
It should raise an AttributeError instead, like the setters generated by Argument Clinic in Modules/_ssl.c.

The same code is in 3.13, 3.14 and 3.15.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15pre-release feature fixes, bugs and security fixes3.16new features, bugs and security fixesextension-modulesC modules in the Modules dirtopic-SSLtype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions