Skip to content

Instantly share code, notes, and snippets.

@rootslab
rootslab / gist:1237478
Created September 23, 2011 14:26
(NodeJs) Buffer Size bug
// https://github.com/joyent/node/blob/master/lib/buffer.js R#~208
...
// Are we slicing?
if (typeof offset === 'number') {
this.length = Math.floor( encoding ); // <-- probably also here
this.parent = subject;
this.offset = offset;
} else {
// Find the length
switch (type = typeof subject) {
var log = console.log
, Kombo = require( '../' )
, test = function ( mbytes ) {
var mb = Math.max( mbytes, 1 )
, b = new Buffer( mb * 1024 * 1024 )
, stime = -1
, etime= -1
, i = 0
;

Keybase proof

I hereby claim:

  • I am rootslab on github.
  • I am assobuco (https://keybase.io/assobuco) on keybase.
  • I have a public key ASCpvt5nIPVp5Kw_UtogGFqYhtyl5pPQNsCmkumHuubxjQo

To claim this, I am signing this object: