joyent/node — Issue #2657: Intermittent failure in Buffer::Base64Write with zero-length string
Author: rvermillion
Created: 2012-02-01 02:34:20+00:00
State: open

When a zero-length string is written to a Buffer, a Buffer from the pool with zero bytes remaining can be selected and will then throw an exception because offset is equal to the buffer length.

This error was occurring sporadically with the node-hbase module which uses buffers to decode the Base64 content, sometimes empty strings, from the HBase REST server.

Adding a check in Buffer::Base64Write for zero-length strings will skip that check and return 0 with less work. I will submit a patch to v0.6.9 that fixes the bug.