The issue I see with this workaround is that it very likely masks other bugs.  To wit:

```javascript
var newbuf = new Buffer(context.trailer.length + input.length);
```

If `input === FLUSH` here, then `context.trailer.length + input.length` equals `context.trailer.length + undefined` equals `NaN`, which means you end up with a zero-length buffer.

I think some more research is needed to properly address this.