Skip to content

Commit

Permalink
better path detection for CABs inside MSIs
Browse files Browse the repository at this point in the history
  • Loading branch information
huettenhain committed Nov 20, 2024
1 parent 203ed1a commit 064c110
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions refinery/units/formats/msi.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,13 @@ def _iscab(path):
dst_name = file_info['FileName']
except KeyError:
continue
short, pipe, long = dst_name.partition('|')
if pipe == '|' and short and long:
file_names[src_name] = long
_, _, long = dst_name.partition('|')
dst_name = long or dst_name
if not re.fullmatch(R'[-\w,.]+', dst_name):
continue
if any(dst_name.count(odd) > 10 for odd in '-,.'):
continue
file_names[src_name] = dst_name

for path, cab in cabs.items():
try:
Expand Down

0 comments on commit 064c110

Please sign in to comment.