From 847584552f3cb07b325cea607e05e57c5fcd1e66 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Fri, 20 Dec 2024 21:21:16 -0800 Subject: [PATCH] fix(process): `process.kill` allows zero or negative pids --- src/bun.js/bindings/BunProcess.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/bun.js/bindings/BunProcess.cpp b/src/bun.js/bindings/BunProcess.cpp index 452c89b97ee0d2..fdc1bf72c7f76c 100644 --- a/src/bun.js/bindings/BunProcess.cpp +++ b/src/bun.js/bindings/BunProcess.cpp @@ -2948,9 +2948,6 @@ JSC_DEFINE_HOST_FUNCTION(Process_functionKill, auto pid_value = callFrame->argument(0); int pid = pid_value.toInt32(globalObject); RETURN_IF_EXCEPTION(scope, {}); - if (pid < 0) { - return Bun::ERR::OUT_OF_RANGE(scope, globalObject, "pid"_s, "a positive integer"_s, pid_value); - } JSC::JSValue signalValue = callFrame->argument(1); int signal = SIGTERM; if (signalValue.isNumber()) {