mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 03:00:18 +02:00
Fix the follow-up review's findings
- APK reader: read members with a bounded read, since ZipFile.read inflates a member fully before trimming it to a forged declared size; the reference walk counts every entry it examines, dead ends and cycles included. - Titles: a path that exists under the root wins over stripping the archive prefix; the prefix is taken before a linked folder is staged elsewhere (another drive on Windows); the install dialog loads a fresh title list first and says so if it couldn't check. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
0530a6d045
commit
dfacf43e55
5 files changed
+85
-15
No files matched your search
@@ -153,6 +153,26 @@ class Targets(unittest.TestCase):
|
||||
with self.assertRaises(FrameError):
|
||||
frame_titles._choose(p, 'Game/../../outside.exe')
|
||||
|
||||
def test_root_relative_path_wins_over_archive_prefix(self):
|
||||
# Game/Game/A.exe and Game/A.exe: 'Game/A.exe' is a real path under the root Game/.
|
||||
p = self.plan({'Game/Game/A.exe': pe(0x8664), 'Game/A.exe': pe(0x8664)}, 'Game')
|
||||
self.assertEqual(p['unwrapped'], 'Game')
|
||||
frame_titles._choose(p, 'Game/A.exe')
|
||||
self.assertEqual(p['target'], 'Game/A.exe')
|
||||
|
||||
@unittest.skipIf(os.name == 'nt', 'needs symlinks')
|
||||
def test_prefix_is_taken_before_staging(self):
|
||||
# A folder with a link is staged into a temporary copy; the prefix still names
|
||||
# the folders stepped into in the original.
|
||||
d = self.tree({'Game/A.exe': pe(0x8664)})
|
||||
os.symlink('A.exe', os.path.join(d, 'Game', 'link.exe'))
|
||||
p = frame_titles.inspect(d, 'Game')
|
||||
try:
|
||||
self.assertEqual(p['unwrapped'], 'Game')
|
||||
self.assertTrue(p['work'])
|
||||
finally:
|
||||
frame_titles.discard(p)
|
||||
|
||||
|
||||
class Zips(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
||||
Reference in new issue
Block a user