[buffer] Fix construction of zero length buffers