joyent/node — pull request #5845 by eddyb (2013-07-13 19:39:41+00:00)
Title: Enable creating a Buffer with NULL data by relaxing an assert in smalloc.

This re-allows creating a NULL Buffer when there is no risk of dereferencing it in JS land.

It is required by the [ref module](https://github.com/TooTallNate/ref), which has a NULL "pointer" constant and also can read an arbitrary "pointer" (Buffer), NULL or otherwise, from memory.

I have come across this problem while updating the [ref module](https://github.com/TooTallNate/ref) to build against node.js master and v8 bleeding edge.
From [ref source](https://github.com/TooTallNate/ref/blob/master/src/binding.cc#L111-L124):
```cc
/*
* Creates the "null_pointer_buffer" Buffer instance that points to NULL.
* It has a length of 0 so that you don't accidentally try to deref the NULL
* pointer in JS-land by doing something like: `ref.NULL[0]`.
*/
```