gh-146091: Fix NULL check in termios.tcsetwinsize by okiemute04 · Pull Request #146147 · python/cpython
-
-
Notifications
You must be signed in to change notification settings - Fork 34.8k
Conversation
Fixes #146091
Add proper NULL checks for PySequence_GetItem results before passing
to PyLong_AsLong, this prevents SystemError when a BadSequence raises
TypeError in getitem, the issue was that PySequence_GetItem can return NULL, which when passed to PyLong_AsLong would cause an internal error instead of propagating
the original exception.
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.
If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.
Add proper NULL checks for PySequence_GetItem results before passing to PyLong_AsLong. This prevents SystemError when a BadSequence raises TypeError in __getitem__.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters