1 Commits

Author SHA1 Message Date
alu f3b279e636 fix possible crash caused by malformed rate request 2026-07-06 18:28:53 +00:00
+5
View File
@@ -121,6 +121,11 @@ if (schemes.interrupt.enabled) {
if (cmd === "rate" && parsed.length === 2 && parsed[1] >= schemes.interrupt["min-rate"] && parsed[1] <= schemes.interrupt["max-rate"]) {
// get requested rate in ms
const rate = Number(parsed[1]) * 1000;
if (isNaN(rate)) {
socket.send("error: rate <rate> must be a number");
socket.terminate();
return;
}
// if timer has not started, start it with requested rate
if (!timer) {
timer = setTimeout(handleInterruptSync, rate);