fix(ghidra): match upstream OS selection and refuse indirect JVM options

This commit is contained in:
morluto
2026-10-14 07:43:08 +08:00
parent 20e4f83097
commit 739cf68e1a
5 changed files with 71 additions and 8 deletions
@@ -273,6 +273,22 @@ describe.skipIf(process.platform === "win32")(
expect(analysisArguments).toHaveLength(1);
});
it.each(["@options", '"@options with spaces"'])(
"refuses indirect JVM options (%s) instead of assuming platform alignment",
async (value) => {
const { session, launcher, analysisArguments } = await fixture(
`env-injection:JDK_JAVA_OPTIONS=${value}`,
);
const launched = await launcher.launch(session);
expect(launched.ok).toBe(false);
expect(analysisArguments).toEqual([]);
if (launched.ok) throw new Error("Expected an argument-file refusal");
expect(launched.error.cause).toMatchObject({
message: expect.stringContaining("may not supply JVM argument files"),
});
},
);
it("bounds retained UTF-8 warnings and reports original byte counts", async () => {
const { session, launcher } = await fixture("large");
const launched = await launcher.launch(session);