diff options
Diffstat (limited to 'meta/recipes-devtools/python/python3/0001-gh-114492-Initialize-struct-termios-before-calling-t.patch')
| -rw-r--r-- | meta/recipes-devtools/python/python3/0001-gh-114492-Initialize-struct-termios-before-calling-t.patch | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/meta/recipes-devtools/python/python3/0001-gh-114492-Initialize-struct-termios-before-calling-t.patch b/meta/recipes-devtools/python/python3/0001-gh-114492-Initialize-struct-termios-before-calling-t.patch index 141b708a67..8406ef30a2 100644 --- a/meta/recipes-devtools/python/python3/0001-gh-114492-Initialize-struct-termios-before-calling-t.patch +++ b/meta/recipes-devtools/python/python3/0001-gh-114492-Initialize-struct-termios-before-calling-t.patch | |||
| @@ -1,8 +1,9 @@ | |||
| 1 | From bd0e1bf1504a5cba12133548bc49f1fcaf7b4da2 Mon Sep 17 00:00:00 2001 | 1 | From 439aa02f42d6e6715c172076261757fcb89a936a Mon Sep 17 00:00:00 2001 |
| 2 | From: "Miss Islington (bot)" | 2 | From: "Miss Islington (bot)" |
| 3 | <31488909+miss-islington@users.noreply.github.com> | 3 | <31488909+miss-islington@users.noreply.github.com> |
| 4 | Date: Tue, 23 Jan 2024 23:02:02 +0100 | 4 | Date: Tue, 23 Jan 2024 23:02:02 +0100 |
| 5 | Subject: [PATCH] gh-114492: Initialize struct termios before calling tcgetattr() (GH-114495) (GH-114502) | 5 | Subject: [PATCH] gh-114492: Initialize struct termios before calling |
| 6 | tcgetattr() (GH-114495) (GH-114502) | ||
| 6 | 7 | ||
| 7 | On Alpine Linux it could leave some field non-initialized. | 8 | On Alpine Linux it could leave some field non-initialized. |
| 8 | (cherry picked from commit d22c066b802592932f9eb18434782299e80ca42e) | 9 | (cherry picked from commit d22c066b802592932f9eb18434782299e80ca42e) |
| @@ -12,8 +13,7 @@ Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> | |||
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 13 | --- | 14 | --- |
| 14 | .../next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst | 2 ++ | 15 | .../next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst | 2 ++ |
| 15 | Modules/termios.c | 2 ++ | 16 | 1 file changed, 2 insertions(+) |
| 16 | 2 files changed, 4 insertions(+) | ||
| 17 | create mode 100644 Misc/NEWS.d/next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst | 17 | create mode 100644 Misc/NEWS.d/next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst |
| 18 | 18 | ||
| 19 | diff --git a/Misc/NEWS.d/next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst b/Misc/NEWS.d/next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst | 19 | diff --git a/Misc/NEWS.d/next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst b/Misc/NEWS.d/next/Library/2024-01-23-21-20-40.gh-issue-114492.vKxl5o.rst |
| @@ -24,19 +24,3 @@ index 0000000..8df8299 | |||
| 24 | @@ -0,0 +1,2 @@ | 24 | @@ -0,0 +1,2 @@ |
| 25 | +Make the result of :func:`termios.tcgetattr` reproducible on Alpine Linux. | 25 | +Make the result of :func:`termios.tcgetattr` reproducible on Alpine Linux. |
| 26 | +Previously it could leave a random garbage in some fields. | 26 | +Previously it could leave a random garbage in some fields. |
| 27 | diff --git a/Modules/termios.c b/Modules/termios.c | ||
| 28 | index c3d96cc..402e6ac 100644 | ||
| 29 | --- a/Modules/termios.c | ||
| 30 | +++ b/Modules/termios.c | ||
| 31 | @@ -84,6 +84,8 @@ termios_tcgetattr_impl(PyObject *module, int fd) | ||
| 32 | struct termios mode; | ||
| 33 | int r; | ||
| 34 | |||
| 35 | + /* Alpine Linux can leave some fields uninitialized. */ | ||
| 36 | + memset(&mode, 0, sizeof(mode)); | ||
| 37 | Py_BEGIN_ALLOW_THREADS | ||
| 38 | r = tcgetattr(fd, &mode); | ||
| 39 | Py_END_ALLOW_THREADS | ||
| 40 | -- | ||
| 41 | 2.43.0 | ||
| 42 | |||
