Skip to content

Commit 993ecaa

Browse files
committed
fix(extractor): do not keep symlinks with empty targets.
1 parent 5d9fd6d commit 993ecaa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

unblob/extractor.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ def fix_symlink(path: Path, outdir: Path, task_result: TaskResult) -> Path:
6161
path.unlink()
6262
return path
6363

64-
target = Path(os.readlink(path))
64+
raw_target = os.readlink(path)
65+
if not raw_target:
66+
logger.error("Symlink with empty target, removing.")
67+
path.unlink()
68+
return path
69+
70+
target = Path(raw_target)
6571

6672
if target.is_absolute():
6773
target = Path(target.as_posix().lstrip("/"))

0 commit comments

Comments
 (0)