8000 Handle errors correctly in `os_get_terminal_size_impl` in `posixmodule.c` · Issue #116520 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Handle errors correctly in os_get_terminal_size_impl in posixmodule.c #116520

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

Closed
sobolevn opened this issue Mar 8, 2024 · 0 comments
Closed

Handle errors correctly in os_get_terminal_size_impl in posixmodule.c #116520

sobolevn opened this issue Mar 8, 2024 · 0 comments
Assignees
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member
sobolevn commented Mar 8, 2024

Bug report

Here the first possible error will be overwritten by the second one:

cpython/Modules/posixmodule.c

Lines 14981 to 14990 in 3cdfdc0

termsize = PyStructSequence_New((PyTypeObject *)TerminalSizeType);
if (termsize == NULL)
return NULL;
PyStructSequence_SET_ITEM(termsize, 0, PyLong_FromLong(columns));
PyStructSequence_SET_ITEM(termsize, 1, PyLong_FromLong(lines));
if (PyErr_Occurred()) {
Py_DECREF(termsize);
return NULL;
}
return termsize;

Linked PRs

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error extension-modules C modules in the Modules dir labels Mar 8, 2024
@sobolevn sobolevn self-assigned this Mar 8, 2024
sobolevn added a commit to sobolevn/cpython that referenced this issue Mar 8, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 9, 2024
… `posixmodule` (pythonGH-116521)

(cherry picked from commit b4b4e76)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 9, 2024
… `posixmodule` (pythonGH-116521)

(cherry picked from commit b4b4e76)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
sobolevn added a commit that referenced this issue Mar 9, 2024
…n `posixmodule` (GH-116521) (#116539)

gh-116520: Fix error handling in `os_get_terminal_size_impl` in `posixmodule` (GH-116521)
(cherry picked from commit b4b4e76)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
sobolevn added a commit that referenced this issue Mar 9, 2024
…n `posixmodule` (GH-116521) (#116540)

gh-116520: Fix error handling in `os_get_terminal_size_impl` in `posixmodule` (GH-116521)
(cherry picked from commit b4b4e76)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@sobolevn sobolevn closed this as completed Mar 9, 2024
adorilson pushed a commit to adorilson/cpython that referenced this issue Mar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant
0