Skip to content

Commit

Permalink
push.apply with an unbounded array leads to stack overflow exceptions.
Browse files Browse the repository at this point in the history
fix for #827
  • Loading branch information
jdmarshall committed Oct 26, 2023
1 parent 9ce526e commit 868e786
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 @@ -106,7 +106,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 868e786

Please sign in to comment.