◐ Shell
clean mode source ↗

gh-106030: Miscellaneous fixes in Python/suggestions.c by serhiy-storchaka · Pull Request #106031 · python/cpython

* 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

pablogsal

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 <storchaka@gmail.com>

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 <storchaka@gmail.com>

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 <storchaka@gmail.com>

hauntsaninja pushed a commit that referenced this pull request

Jun 27, 2023
) (#106036)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>