mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-114492: Initialize struct termios before calling tcgetattr() (GH-114495)
On Alpine Linux it could leave some field non-initialized.
This commit is contained in:
parent
ce01ab536f
commit
d22c066b80
2 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue