go-macaroon / js-macaroon

Javascript implementation of macaroons
BSD 3-Clause "New" or "Revised" License
41 stars 22 forks source link

this._capacity is never defined causing buffer growing too large when exporting to binary format #41

Closed guenoledc closed 5 years ago

guenoledc commented 5 years ago

At line: https://github.com/go-macaroon/js-macaroon/blob/15a163659ef213d2eee69f4605904ca52ff15426/macaroon.js#L125

minCap <= this._capacity is always false because this_capacity is undefined

Recommendation: Change the constructor

  constructor(capacity) {
    this._buf = new Uint8Array(capacity);
    this._length = 0;
    this._capacity = capacity
  }
guenoledc commented 5 years ago

seems resolved in https://github.com/go-macaroon/js-macaroon/pull/40 Could you merge the pull request ?

hatched commented 5 years ago

This issue has now been resolved with #40 being merged.