GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-145376: Fix null pointer deref in md5module.c by eendebakpt · Pull Request #145422 · python/cpython Conversation
|
Not sure what C/C a b is, but the pattern is indeed the same. E.g. Line 89 in 02288bf
There the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
it was meant to be a "C/C a bit" and I used C/C for "carbon copy" (which is essentially to mean "copy-paste" for me)
Likely to prevent a double-free (I don't know if it was me or tiran/gpshead who added this) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Actually it was me in 261633b. I just forgot about the MD5 one I think. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Oh and please also put the state to NULL just to prevent a possible double-free |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| int rc = py_hmac_hinfo_ht_add(table, KEY, value); \ | ||
| if (rc < 0) { \ | ||
| PyMem_Free(value); \ | ||
| if (value->refcnt == 0) { \ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This one is already part of an other PR actually.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Namely: #145321.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I would prefer merging PR gh-145321 first since it's older and more complete.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I am waiting for the other PR and will rebase accordingly.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
i just merged the above.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The md5 change LGTM. I'm not sure that it's worth it to add a NEWS entry for this change, since it's unlikely to hit this bug in practice.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| int rc = py_hmac_hinfo_ht_add(table, KEY, value); \ | ||
| if (rc < 0) { \ | ||
| PyMem_Free(value); \ | ||
| if (value->refcnt == 0) { \ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I would prefer merging PR gh-145321 first since it's older and more complete.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I prefer to always include a NEWS entry for crashes even if they are rare. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Victor Stinner <[email protected]>
There was an error while loading. Please reload this page.
Co-authored-by: Bénédikt Tran <[email protected]>
There was an error while loading. Please reload this page.
|
@eendebakpt Thanks for the PR! Once it's merged, could you do a manual backport for 3.13 and an automatic backport for 3.14 (though I'm not entirely sure about conflicts in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @eendebakpt for the PR, and @picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…honGH-145422) Fix a possible NULL pointer dereference in `md5module.c` and a double-free in `hmacmodule.c`. Those crashes only occur in error paths taken when the interpreter fails to allocate memory. (cherry picked from commit c1d7768) Co-authored-by: Pieter Eendebak <[email protected]>
|
GH-145610 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-145611 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…-145422) (#145610) gh-145376: Fix crashes in `md5module.c` and `hmacmodule.c` (GH-145422) Fix a possible NULL pointer dereference in `md5module.c` and a double-free in `hmacmodule.c`. Those crashes only occur in error paths taken when the interpreter fails to allocate memory. (cherry picked from commit c1d7768) Co-authored-by: Pieter Eendebak <[email protected]>
* gh-145376: Fix crashes in md5module.c 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) * 📜🤖 Added by blurb_it. * Update Modules/md5module.c --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
…hon#145422) Fix a possible NULL pointer dereference in `md5module.c` and a double-free in `hmacmodule.c`. Those crashes only occur in error paths taken when the interpreter fails to allocate memory.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.