diff options
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-pillow/0001-Initialize-coordinates-to-zero.patch')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-pillow/0001-Initialize-coordinates-to-zero.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-pillow/0001-Initialize-coordinates-to-zero.patch b/meta-python/recipes-devtools/python/python3-pillow/0001-Initialize-coordinates-to-zero.patch new file mode 100644 index 0000000000..758531f678 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pillow/0001-Initialize-coordinates-to-zero.patch | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | From 1e092419b6806495c683043ab3feb6ce264f3b9c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andrew Murray <radarhere@users.noreply.github.com> | ||
| 3 | Date: Mon, 6 Dec 2021 22:24:19 +1100 | ||
| 4 | Subject: [PATCH] Initialize coordinates to zero | ||
| 5 | |||
| 6 | CVE: CVE-2022-22815 | ||
| 7 | |||
| 8 | Upstream-Status: Backport | ||
| 9 | (https://github.com/python-pillow/Pillow/pull/5920/commits/1e092419b6806495c683043ab3feb6ce264f3b9c) | ||
| 10 | |||
| 11 | Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com> | ||
| 12 | |||
| 13 | --- | ||
| 14 | Tests/test_imagepath.py | 1 + | ||
| 15 | src/path.c | 2 +- | ||
| 16 | 2 files changed, 2 insertions(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/Tests/test_imagepath.py b/Tests/test_imagepath.py | ||
| 19 | index 0835fdb4..cd850bb1 100644 | ||
| 20 | --- a/Tests/test_imagepath.py | ||
| 21 | +++ b/Tests/test_imagepath.py | ||
| 22 | @@ -90,6 +90,7 @@ def test_path_odd_number_of_coordinates(): | ||
| 23 | [ | ||
| 24 | ([0, 1, 2, 3], (0.0, 1.0, 2.0, 3.0)), | ||
| 25 | ([3, 2, 1, 0], (1.0, 0.0, 3.0, 2.0)), | ||
| 26 | + (1, (0.0, 0.0, 0.0, 0.0)), | ||
| 27 | ], | ||
| 28 | ) | ||
| 29 | def test_getbbox(coords, expected): | ||
| 30 | diff --git a/src/path.c b/src/path.c | ||
| 31 | index 4764c58a..64c767cb 100644 | ||
| 32 | --- a/src/path.c | ||
| 33 | +++ b/src/path.c | ||
| 34 | @@ -57,7 +57,7 @@ alloc_array(Py_ssize_t count) { | ||
| 35 | if ((unsigned long long)count > (SIZE_MAX / (2 * sizeof(double))) - 1) { | ||
| 36 | return ImagingError_MemoryError(); | ||
| 37 | } | ||
| 38 | - xy = malloc(2 * count * sizeof(double) + 1); | ||
| 39 | + xy = calloc(2 * count * sizeof(double) + 1, sizeof(double)); | ||
| 40 | if (!xy) { | ||
| 41 | ImagingError_MemoryError(); | ||
| 42 | } | ||
| 43 | -- | ||
| 44 | 2.33.0 | ||
| 45 | |||
