Skip to content

[3.13] gh-145376: Fix crashes in md5module.c (GH-145422)#145611

Merged
vstinner merged 3 commits intopython:3.13from
eendebakpt:md5module_null_313
Mar 6, 2026
Merged

[3.13] gh-145376: Fix crashes in md5module.c (GH-145422)#145611
vstinner merged 3 commits intopython:3.13from
eendebakpt:md5module_null_313

Conversation

@eendebakpt
Copy link
Contributor

@eendebakpt eendebakpt commented Mar 6, 2026

Fix a possible NULL pointer dereference in md5module.c.
This can only occur in error paths taken when the interpreter fails to allocate memory.

(cherry-picked from c1d7768)

Fix a possible NULL pointer dereference in `md5module.c`.
This can only occur in error paths taken when the interpreter fails to allocate memory.

(cherry-picked from c1d7768)
Hacl_Hash_MD5_free(ptr->hash_state);
if (ptr->hash_state != NULL) {
Hacl_Hash_MD5_free(ptr->hash_state);
ptr->hash_state == NULL;
Copy link
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;

@vstinner vstinner enabled auto-merge (squash) March 6, 2026 22:12
@vstinner vstinner merged commit ae7206e into python:3.13 Mar 6, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants