diff --git a/lib/buffer.js b/lib/buffer.js index dde229a2ea99ab..f125806622d49d 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -157,6 +157,12 @@ function palloc(that, length) { var buf = sliceOnto(allocPool, that, start, end); poolOffset = end; + // Ensure aligned slices + if (poolOffset & 0x7) { + poolOffset |= 0x7; + poolOffset++; + } + return buf; }