Skip to content

Commit

Permalink
fix: fix symlink handling (#4054)
Browse files Browse the repository at this point in the history
Fix symlink handling added by commit
f13f559: if one of the file is a link,
filenames list will be updated resulting in the loop ending before all
links are removed. To avoid this issue, loop on a copy of filenames.

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
  • Loading branch information
ffontaine committed Apr 19, 2024
1 parent 467ef3f commit 22415d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cve_bin_tool/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def walk(self, roots: list[str] | None = None) -> Iterator[str]:
for root in roots:
for dirpath, dirnames, filenames in os.walk(root):
# Filters
for filename in filenames:
for filename in filenames.copy():
try:
if (
not self.pattern_match(
Expand Down

0 comments on commit 22415d3

Please sign in to comment.