Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-106831: Fix NULL check of d2i_SSL_SESSION result in _ssl.c #106832

Merged
merged 2 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix potential missing ``NULL`` check of ``d2i_SSL_SESSION`` result in
``_ssl.c``.
3 changes: 2 additions & 1 deletion Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2822,7 +2822,8 @@ _ssl_session_dup(SSL_SESSION *session) {
}
const_p = senc;
newsession = d2i_SSL_SESSION(NULL, &const_p, slen);
if (session == NULL) {
if (newsession == NULL) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, now I see the typo! Previous, session was checked, but newsession must checked! Nicely spotted.

PyErr_SetString(PyExc_ValueError, "d2i() failed.");
sobolevn marked this conversation as resolved.
Show resolved Hide resolved
goto error;
}
PyMem_Free(senc);
Expand Down
Loading