Skip to content

Commit

Permalink
fix: push.apply with an unbounded array leads to stack overflow excep…
Browse files Browse the repository at this point in the history
…tions. (#830)

fix for #827
  • Loading branch information
jdmarshall committed Nov 6, 2023
1 parent 650807a commit 2cfb1ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 2cfb1ae

Please sign in to comment.