Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-126108: Fix potential null pointer dereference in PySys_AddWarnOptionUnicode#126118
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from8 commits
e3551862ca65fe0fb17bc6c22e446cd01fda969026166759993231835cd8e30f23471167b9de27d0754fFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix a possible ``NULL`` pointer dereference in :c:func:`!PySys_AddWarnOptionUnicode`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2838,6 +2838,7 @@ PySys_ResetWarnOptions(void) | ||
| static int | ||
| _PySys_AddWarnOptionWithError(PyThreadState *tstate, PyObject *option) | ||
| { | ||
| assert(tstate != NULL); | ||
| PyObject *warnoptions = get_warnoptions(tstate); | ||
| if (warnoptions == NULL) { | ||
| return -1; | ||
| @@ -2853,11 +2854,9 @@ PyAPI_FUNC(void) | ||
| PySys_AddWarnOptionUnicode(PyObject *option) | ||
| { | ||
| PyThreadState *tstate = _PyThreadState_GET(); | ||
federicovalenso marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| if (tstate &&_PySys_AddWarnOptionWithError(tstate, option) < 0) { | ||
federicovalenso marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| /* No return value, therefore clear error state if possible */ | ||
picnixz marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| _PyErr_Clear(tstate); | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I assume that there's no way to make Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I agree, Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Would it actually make sense to have Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Ok, in that case, I would like ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Should I do some other changes or leave as is? Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Should we also do it in Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading.Please reload this page.