Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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 @@
Fix null pointer dereference in unusual error scenario in :mod:`hashlib`.
Comment thread
eendebakpt marked this conversation as resolved.
5 changes: 4 additions & 1 deletion Modules/md5module.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@
static void
MD5_dealloc(MD5object *ptr)
{
Hacl_Hash_MD5_free(ptr->hash_state);
if (ptr->hash_state != NULL) {
Hacl_Hash_MD5_free(ptr->hash_state);
ptr->hash_state == NULL;

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

statement with no effect [-Wunused-value]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

statement with no effect [-Wunused-value]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.3.6)

statement with no effect [-Wunused-value]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 1.1.1w)

statement with no effect [-Wunused-value]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.4.4)

statement with no effect [-Wunused-value]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.0.19)

statement with no effect [-Wunused-value]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.5.5)

statement with no effect [-Wunused-value]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.6.1)

statement with no effect [-Wunused-value]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

statement with no effect [-Wunused-value]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

statement with no effect [-Wunused-value]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

statement with no effect [-Wunused-value]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

statement with no effect [-Wunused-value]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'==': result of expression not used; did you intend '='? [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'==': result of expression not used; did you intend '='? [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'==': result of expression not used; did you intend '='? [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check warning on line 89 in Modules/md5module.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'==': result of expression not used; did you intend '='? [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This line should be: ptr->hash_state = NULL;

Comment thread
eendebakpt marked this conversation as resolved.
Outdated
}
PyTypeObject *tp = Py_TYPE((PyObject*)ptr);
PyObject_GC_UnTrack(ptr);
PyObject_GC_Del(ptr);
Expand Down
Loading