forked from mirrors/pyinstxtractor
Handle CArchive entries starting with an absolute file path, closes #67
This commit is contained in:
parent
cad8c74542
commit
5268087d25
1 changed files with 5 additions and 0 deletions
|
|
@ -232,6 +232,11 @@ class PyInstArchive:
|
|||
self.fPtr.read(entrySize - 4))
|
||||
|
||||
name = name.decode('utf-8').rstrip('\0')
|
||||
|
||||
# Prevent writing outside the extraction directory
|
||||
if name.startswith("/"):
|
||||
name = name.lstrip("/")
|
||||
|
||||
if len(name) == 0:
|
||||
name = str(uniquename())
|
||||
print('[!] Warning: Found an unamed file in CArchive. Using random name {0}'.format(name))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue