diff options
Diffstat (limited to 'meta/recipes-devtools/python/python3-zipp/0004-Address-infinite-loop-when-zipfile-begins-with-more-.patch')
| -rw-r--r-- | meta/recipes-devtools/python/python3-zipp/0004-Address-infinite-loop-when-zipfile-begins-with-more-.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-zipp/0004-Address-infinite-loop-when-zipfile-begins-with-more-.patch b/meta/recipes-devtools/python/python3-zipp/0004-Address-infinite-loop-when-zipfile-begins-with-more-.patch new file mode 100644 index 0000000000..46871122a9 --- /dev/null +++ b/meta/recipes-devtools/python/python3-zipp/0004-Address-infinite-loop-when-zipfile-begins-with-more-.patch | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | From ef4ee19919bd49a9c1207ff8d87f83dd48aed436 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Jason R. Coombs" <jaraco@jaraco.com> | ||
| 3 | Date: Wed, 27 Nov 2024 23:35:28 -0800 | ||
| 4 | Subject: [PATCH 4/5] Address infinite loop when zipfile begins with more than | ||
| 5 | one leading slash. | ||
| 6 | |||
| 7 | Alternate and more surgical fix for jaraco/zipp#119. Ref python/cpython#123270 | ||
| 8 | |||
| 9 | Upstream-Status: Backport [https://github.com/jaraco/zipp/commit/f89b93f0370dd85d23d243e25dfc1f99f4d8de48] | ||
| 10 | Remove test codes | ||
| 11 | Rebase to v3.7.0 | ||
| 12 | CVE: CVE-2024-5569 | ||
| 13 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 14 | --- | ||
| 15 | zipp.py | 8 ++++++-- | ||
| 16 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/zipp.py b/zipp.py | ||
| 19 | index 26b723c..236af49 100644 | ||
| 20 | --- a/zipp.py | ||
| 21 | +++ b/zipp.py | ||
| 22 | @@ -37,7 +37,7 @@ def _parents(path): | ||
| 23 | def _ancestry(path): | ||
| 24 | """ | ||
| 25 | Given a path with elements separated by | ||
| 26 | - posixpath.sep, generate all elements of that path | ||
| 27 | + posixpath.sep, generate all elements of that path. | ||
| 28 | |||
| 29 | >>> list(_ancestry('b/d')) | ||
| 30 | ['b/d', 'b'] | ||
| 31 | @@ -49,9 +49,13 @@ def _ancestry(path): | ||
| 32 | ['b'] | ||
| 33 | >>> list(_ancestry('')) | ||
| 34 | [] | ||
| 35 | + Multiple separators are treated like a single. | ||
| 36 | + | ||
| 37 | + >>> list(_ancestry('//b//d///f//')) | ||
| 38 | + ['//b//d///f', '//b//d', '//b'] | ||
| 39 | """ | ||
| 40 | path = path.rstrip(posixpath.sep) | ||
| 41 | - while path and path != posixpath.sep: | ||
| 42 | + while path and not path.endswith(posixpath.sep): | ||
| 43 | yield path | ||
| 44 | path, tail = posixpath.split(path) | ||
| 45 | |||
| 46 | -- | ||
| 47 | 2.25.1 | ||
| 48 | |||
