Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Make the result of :func:`termios.tcgetattr` reproducible on Alpine Linux.
Previously it could leave a random garbage in some fields.
2 changes: 2 additions & 0 deletions Modules/termios.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ termios_tcgetattr_impl(PyObject *module, int fd)
struct termios mode;
int r;

/* Alpine Linux can leave some fields uninitialized. */
memset(&mode, 0, sizeof(mode));
Py_BEGIN_ALLOW_THREADS
r = tcgetattr(fd, &mode);
Py_END_ALLOW_THREADS
Expand Down