Skip to content

gh-106030: Miscellaneous fixes in Python/suggestions.c #106031

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

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jun 23, 2023

  • PyDict_GetItem() and PyObject_HasAttr() suppress arbitrary errors and should not be used.
  • PyUnicode_CompareWithASCIIString() only works if the second argument is ASCII string.
  • Refleak in get_suggestions_for_name_error.
  • Use of borrowed pointer after possible freeing (self).
  • Add some missing error checks.

* PyDict_GetItem() and PyObject_HasAttr() suppress arbitrary errors and
  should not be used.
* PyUnicode_CompareWithASCIIString() only works if the second argument
  is ASCII string.
* Refleak in get_suggestions_for_name_error.
* Use of borrowed pointer after possible freeing (self).
* Add some missing error checks.
@AlexWaygood AlexWaygood changed the title gh-106030: Miscaleous fixes in Python/suggestions.c gh-106030: Miscellaneous fixes in Python/suggestions.c Jun 23, 2023
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@serhiy-storchaka serhiy-storchaka deleted the suggestions branch June 23, 2023 16:53
@miss-islington
Copy link
Contributor

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker c8c162ef5294cddb7ac75fe93ab918e5661c68ee 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 23, 2023
…H-106031)

* PyDict_GetItem() and PyObject_HasAttr() suppress arbitrary errors and
  should not be used.
* PyUnicode_CompareWithASCIIString() only works if the second argument
  is ASCII string.
* Refleak in get_suggestions_for_name_error.
* Use of borrowed pointer after possible freeing (self).
* Add some missing error checks.
(cherry picked from commit c8c162e)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot
Copy link

GH-106036 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Jun 23, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Jun 23, 2023
…ythonGH-106031)

* PyDict_GetItem() and PyObject_HasAttr() suppress arbitrary errors and
  should not be used.
* PyUnicode_CompareWithASCIIString() only works if the second argument
  is ASCII string.
* Refleak in get_suggestions_for_name_error.
* Use of borrowed pointer after possible freeing (self).
* Add some missing error checks..
(cherry picked from commit c8c162e)

Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Jun 23, 2023
…ythonGH-106031)

* PyUnicode_CompareWithASCIIString() only works if the second argument
  is ASCII string.
* Refleak in get_suggestions_for_name_error.
* Add some missing error checks..
(cherry picked from commit c8c162e)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-bot
Copy link

GH-106039 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jun 23, 2023
hauntsaninja pushed a commit that referenced this pull request Jun 27, 2023
@serhiy-storchaka serhiy-storchaka removed their assignment Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants