From 2cfb1aeb8649359b0e8adc44b20bce61ee2bb3c1 Mon Sep 17 00:00:00 2001 From: Jason Marshall Date: Mon, 6 Nov 2023 07:01:48 -0800 Subject: [PATCH] fix: push.apply with an unbounded array leads to stack overflow exceptions. (#830) fix for #827 --- lib/status.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/status.js b/lib/status.js index 53a05fcc..ab0a386c 100644 --- a/lib/status.js +++ b/lib/status.js @@ -121,7 +121,9 @@ class Status extends EventEmitter { }); if (this.rollingPercentilesEnabled) { - acc.latencyTimes.push.apply(acc.latencyTimes, val.latencyTimes || []); + if (val.latencyTimes) { + acc.latencyTimes = acc.latencyTimes.concat(val.latencyTimes); + } } return acc; }, bucket());