summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3-zipp/0005-Prefer-simpler-path.rstrip-to-consolidate-checks-for.patch
blob: de91c683610c1b840f83fd760d29d116bd22ae04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 9084bc59784cb240628996c1cb95f4f786ebedcc Mon Sep 17 00:00:00 2001
From: "Jason R. Coombs" <jaraco@jaraco.com>
Date: Wed, 27 Nov 2024 23:38:28 -0800
Subject: [PATCH 5/5] Prefer simpler path.rstrip to consolidate checks for
 empty or only paths.

Upstream-Status: Backport [https://github.com/jaraco/zipp/commit/cc61e6140f0dfde2ff372db932442cf6df890f09]
Rebase to v3.7.0
CVE: CVE-2024-5569
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 zipp.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/zipp.py b/zipp.py
index 236af49..87c4219 100644
--- a/zipp.py
+++ b/zipp.py
@@ -55,7 +55,7 @@ def _ancestry(path):
     ['//b//d///f', '//b//d', '//b']
     """
     path = path.rstrip(posixpath.sep)
-    while path and not path.endswith(posixpath.sep):
+    while path.rstrip(posixpath.sep):
         yield path
         path, tail = posixpath.split(path)
 
-- 
2.25.1