mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-28 14:33:38 +00:00
fix(e2e): reject unsafe bundled runtime limits
This commit is contained in:
@@ -68,7 +68,7 @@ function readPositiveInt(raw, fallback, name) {
|
||||
throw new Error(`invalid ${name}: ${text}`);
|
||||
}
|
||||
const parsed = Number(text);
|
||||
if (!Number.isInteger(parsed) || parsed <= 0) {
|
||||
if (!Number.isSafeInteger(parsed) || parsed <= 0) {
|
||||
throw new Error(`invalid ${name}: ${text}`);
|
||||
}
|
||||
return parsed;
|
||||
|
||||
@@ -266,6 +266,14 @@ describe("bundled plugin install/uninstall probe", () => {
|
||||
expect(result.stderr).toContain("invalid bundled plugin runtime index: 1e3");
|
||||
});
|
||||
|
||||
it("rejects unsafe bundled plugin runtime limit env values", async () => {
|
||||
await expect(
|
||||
importRuntimeSmokeWithEnv({
|
||||
OPENCLAW_BUNDLED_PLUGIN_RUNTIME_READY_MS: String(Number.MAX_SAFE_INTEGER + 1),
|
||||
}),
|
||||
).rejects.toThrow("invalid OPENCLAW_BUNDLED_PLUGIN_RUNTIME_READY_MS: 9007199254740992");
|
||||
});
|
||||
|
||||
it("rejects bundled plugin runtime ports outside the TCP range", async () => {
|
||||
const runtimeSmoke = await import(pathToFileURL(runtimeSmokePath).href);
|
||||
const env = {
|
||||
|
||||
Reference in New Issue
Block a user