Skip to content

Commit

Permalink
Merge pull request #139 from kawanet/fix-opaque-overflow
Browse files Browse the repository at this point in the history
fix RangeError: The value of "value" is out of range.
  • Loading branch information
alevy authored Dec 16, 2020
2 parents 1c5d27c + 33e738c commit 9976627
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/memjs/memjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -832,12 +832,10 @@ Client.prototype.perform = function(key, request, seq, callback, retries) {

// Increment the seq value
Client.prototype.incrSeq = function() {
this.seq++;

// Wrap `this.seq` to 32-bits since the field we fit it into is only 32-bits.
if (this.seq == 0xffffffff) {
this.seq = 0;
} else {
this.seq++;
}
this.seq &= 0xffffffff;
};

exports.Client = Client;
Expand Down

0 comments on commit 9976627

Please sign in to comment.