fix(apple): validate dylib candidates and preserve search uncertainty (#1100)

* fix(apple): validate dylib candidates and preserve search uncertainty

* fix(apple): scope embedded dyld uncertainty by search phase

* fix(apple): scope dyld prefixes to eligible paths and platforms

* fix(apple): ignore embedded process settings on library roots
This commit is contained in:
morluto
2026-10-09 01:43:52 +08:00
committed by GitHub
parent 3b2ec69c54
commit 7914e36ab9
9 changed files with 819 additions and 20 deletions
@@ -378,3 +378,15 @@ describe("Mach-O load command reader failures", () => {
});
});
});
it.each([true, false])(
"rejects unconsumed command bytes in wide=%s headers",
async (wide) => {
const bytes = machoImage({ wide, commands: [rpathCommand("ignored")] });
new DataView(bytes.buffer).setUint32(16, 0, true);
expect(await read(bytes)).toMatchObject({
status: "malformed",
reason: expect.stringContaining("sizeofcmds"),
});
},
);