Merge pull request #20 from LeonardGiglhuber/main

Possible heap overflow: Cancelled orders are not removed
This commit is contained in:
David Braun 2023-07-02 22:59:15 -04:00 committed by GitHub
commit d559c657c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,6 +104,20 @@ const Channel = function(length = 0) {
pushes.splice(0, index.push);
shifts.splice(0, index.shift);
// Remove cancelled pushes
for (let i = pushes.length - 1; i >= 0; i--) {
if (pushes[i].cancelled) {
pushes.splice(i, 1);
}
}
// Remove cancelled shifts
for (let i = shifts.length - 1; i >= 0; i--) {
if (shifts[i].cancelled) {
shifts.splice(i, 1);
}
}
};
const readOnly = Object.freeze(