fix(apple): harden dyld cache reads, mappings, and resolution findings

This commit is contained in:
morluto
2026-10-08 15:36:31 +08:00
parent cd622e0e95
commit d081ffbdce
8 changed files with 138 additions and 20 deletions
+7 -1
View File
@@ -37,7 +37,13 @@ export const resolveTreePath = async (
if (entry.kind === "symlink") {
hops += 1;
if (hops > MAX_SYMLINK_HOPS) return { kind: "absent" };
if (entry.target.startsWith("/")) return { kind: "escapes" };
if (
entry.target.startsWith("/") ||
/^[a-zA-Z]:[\\/]/u.test(entry.target) ||
entry.target.startsWith("\\\\") ||
entry.target.startsWith("//")
)
return { kind: "escapes" };
pending.unshift(...segmentsOf(entry.target));
continue;
}