jhermsmeier/node-envelope

buffer slice is out of bounds

jhermsmeier opened this issue · 1 comments

Example:

Received: (qmail 59857 invoked by uid 2); 6 Dec 2012 13:14:47 -0000
Date: 6 Dec 2012 13:14:47 -0000
Message-ID: <20121206131447.59856.qmail@news.ycombinator.com>
From: info@ycombinator.com
To: mail@jhermsmeier.de
Subject: new pw

 New Hacker News pw: XXXXXX

Fails with sourceStart out of bounds in Buffer.prototype.copy()

rich-text-broken-last-boundary.eml 
Error: oob
    at Buffer.slice (buffer.js:553:26)
    at Object.Envelope (/Users/jonas/code/github/node-envelope/envelope.js:25:26)
    at Object.Envelope.parseBody (/Users/jonas/code/github/node-envelope/envelope.js:114:19)
    at Object.Envelope (/Users/jonas/code/github/node-envelope/envelope.js:26:8)
    at /Users/jonas/code/github/node-envelope/test/index.js:12:12
    at Array.forEach (native)
    at Object.<anonymous> (/Users/jonas/code/github/node-envelope/test/index.js:7:7)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)